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
12 ---------------------------------------------------------------------
13 module Gargantext.API.Swagger where
14 ---------------------------------------------------------------------
17 import Data.Version (showVersion)
19 import Servant.Swagger
20 import qualified Paths_gargantext as PG -- cabal magic build module
22 import Gargantext.API.Routes
23 import Gargantext.Prelude
25 -- | Swagger Specifications
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 )
37 urlLicence = "https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/master/LICENSE"