1 {-# OPTIONS_GHC -freduction-depth=400 #-}
4 Module : Gargantext.API.Swagger
5 Description : Swagger API generation
6 Copyright : (c) CNRS, 2017-Present
7 License : AGPL + CECILL v3
8 Maintainer : team@gargantext.org
9 Stability : experimental
14 ---------------------------------------------------------------------
15 module Gargantext.API.Swagger where
16 ---------------------------------------------------------------------
19 import Data.Version (showVersion)
21 import Servant.Swagger
22 import qualified Paths_gargantext as PG -- cabal magic build module
24 import Gargantext.API.Routes
25 import Gargantext.Prelude
27 -- | Swagger Specifications
29 swaggerDoc = toSwagger (Proxy :: Proxy GargAPI)
30 & info.title .~ "GarganText"
31 & info.version .~ (cs $ showVersion PG.version)
32 -- & info.base_url ?~ (URL "http://gargantext.org/")
33 & info.description ?~ "REST API specifications"
34 -- & tags .~ Set.fromList [Tag "Garg" (Just "Main perations") Nothing]
35 & applyTagsFor (subOperations (Proxy :: Proxy GargAPI)(Proxy :: Proxy GargAPI))
36 ["Gargantext" & description ?~ "Main operations"]
37 & info.license ?~ ("AGPLV3 (English) and CECILL (French)" & url ?~ URL urlLicence )
39 urlLicence = "https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/master/LICENSE"