Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
a6cc86a9
Unverified
Commit
a6cc86a9
authored
May 23, 2019
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swagger fixes
parent
6af8ff7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+1
-0
Upload.hs
src/Gargantext/API/Upload.hs
+20
-5
No files found.
src/Gargantext/API/Ngrams.hs
View file @
a6cc86a9
...
@@ -95,6 +95,7 @@ data TODO = TODO
...
@@ -95,6 +95,7 @@ data TODO = TODO
deriving
(
Generic
)
deriving
(
Generic
)
instance
ToSchema
TODO
where
instance
ToSchema
TODO
where
instance
ToParamSchema
TODO
where
------------------------------------------------------------------------
------------------------------------------------------------------------
--data FacetFormat = Table | Chart
--data FacetFormat = Table | Chart
...
...
src/Gargantext/API/Upload.hs
View file @
a6cc86a9
...
@@ -19,29 +19,33 @@ Portability : POSIX
...
@@ -19,29 +19,33 @@ Portability : POSIX
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeOperators #-}
module
Gargantext.API.Upload
module
Gargantext.API.Upload
where
where
import
Control.Lens
((
.~
),
(
?~
))
import
qualified
Data.Text
as
Text
import
qualified
Data.Text
as
Text
import
GHC.Generics
(
Generic
)
import
GHC.Generics
(
Generic
)
import
Gargantext.Prelude
import
Gargantext.Prelude
import
Data.Text
(
Text
)
import
Data.Text
(
Text
)
import
Data.Aeson
import
Data.Aeson
import
Data.Monoid
import
Servant
import
Servant
import
Servant.Multipart
import
Servant.Multipart
--import Servant.Mock (HasMock(mock))
--import Servant.Mock (HasMock(mock))
import
Servant.Swagger
(
HasSwagger
(
toSwagger
))
import
Servant.Swagger
(
HasSwagger
(
toSwagger
))
import
Servant.Swagger.Internal
-- import qualified Data.ByteString.Lazy as LBS
-- import qualified Data.ByteString.Lazy as LBS
import
Control.Monad
import
Control.Monad
import
Control.Monad.IO.Class
import
Control.Monad.IO.Class
import
Gargantext.API.Types
import
Gargantext.API.Types
--import Servant.CSV.Cassava (CSV'(..))
--import Servant.CSV.Cassava (CSV'(..))
--import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
--import Test.QuickCheck.Arbitrary (Arbitrary, arbitrary)
--
import Data.Swagger
import
Data.Swagger
--
import Gargantext.API.Ngrams (TODO)
import
Gargantext.API.Ngrams
(
TODO
)
-- | Upload files
-- | Upload files
-- TODO Is it possible to adapt the function according to iValue input ?
-- TODO Is it possible to adapt the function according to iValue input ?
...
@@ -52,12 +56,23 @@ import Gargantext.API.Types
...
@@ -52,12 +56,23 @@ import Gargantext.API.Types
--instance ToSchema Mem
--instance ToSchema Mem
--instance Arbitrary Mem
--instance Arbitrary Mem
--instance ToSchema (MultipartData Mem)
instance
ToParamSchema
(
MultipartData
Mem
)
where
toParamSchema
_
=
toParamSchema
(
Proxy
::
Proxy
TODO
)
--instance Arbitrary ( MultipartData Mem)
--instance Arbitrary ( MultipartData Mem)
instance
HasSwagger
(
MultipartForm
tag
a
:>
sub
)
where
instance
(
ToParamSchema
a
,
HasSwagger
sub
)
=>
HasSwagger
(
MultipartForm
tag
a
:>
sub
)
where
-- TODO
-- TODO
toSwagger
_
=
undefined
-- toSwagger (Proxy :: Proxy (TODO :> Post '[JSON] ()))
toSwagger
_
=
toSwagger
(
Proxy
::
Proxy
sub
)
&
addParam
param
where
param
=
mempty
&
required
?~
True
&
schema
.~
ParamOther
sch
sch
=
mempty
&
in_
.~
ParamFormData
&
paramSchema
.~
toParamSchema
(
Proxy
::
Proxy
a
)
--declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy TODO)
--declareNamedSchema _ = declareNamedSchema (Proxy :: Proxy TODO)
--instance Arbitrary (MultipartForm Mem (MultipartData Mem))
--instance Arbitrary (MultipartForm Mem (MultipartData Mem))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment