]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/API/Swagger.hs
[Clean] refact + toGroupedTree WIP
[gargantext.git] / src / Gargantext / API / Swagger.hs
1 {-|
2 Module : Gargantext.API.Swagger
3 Description : Swagger API generation
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
8 Portability : POSIX
9
10 -}
11
12 ---------------------------------------------------------------------
13 module Gargantext.API.Swagger where
14 ---------------------------------------------------------------------
15 import Control.Lens
16 import Data.Swagger
17 import Data.Version (showVersion)
18 import Servant
19 import Servant.Swagger
20 import qualified Paths_gargantext as PG -- cabal magic build module
21
22 import Gargantext.API.Routes
23 import Gargantext.Prelude
24
25 -- | Swagger Specifications
26 swaggerDoc :: Swagger
27 swaggerDoc = toSwagger (Proxy :: Proxy GargAPI)
28 & info.title .~ "Gargantext"
29 & info.version .~ (cs $ showVersion PG.version)
30 -- & info.base_url ?~ (URL "http://gargantext.org/")
31 & info.description ?~ "REST API specifications"
32 -- & tags .~ Set.fromList [Tag "Garg" (Just "Main perations") Nothing]
33 & applyTagsFor (subOperations (Proxy :: Proxy GargAPI)(Proxy :: Proxy GargAPI))
34 ["Gargantext" & description ?~ "Main operations"]
35 & info.license ?~ ("AGPLV3 (English) and CECILL (French)" & url ?~ URL urlLicence )
36 where
37 urlLicence = "https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/master/LICENSE"