]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/API/Swagger.hs
Merge remote-tracking branch 'origin/213-dev-implement-json-errors' into dev
[gargantext.git] / src / Gargantext / API / Swagger.hs
1 {-# OPTIONS_GHC -freduction-depth=400 #-}
2
3 {-|
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
10 Portability : POSIX
11
12 -}
13
14 ---------------------------------------------------------------------
15 module Gargantext.API.Swagger where
16 ---------------------------------------------------------------------
17 import Control.Lens
18 import Data.Swagger
19 import Data.Version (showVersion)
20 import Servant
21 import Servant.Swagger
22 import qualified Paths_gargantext as PG -- cabal magic build module
23
24 import Gargantext.API.Routes
25 import Gargantext.Prelude
26
27 -- | Swagger Specifications
28 swaggerDoc :: Swagger
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 )
38 where
39 urlLicence = "https://gitlab.iscpif.fr/gargantext/haskell-gargantext/blob/master/LICENSE"