File tree Expand file tree Collapse file tree 3 files changed +543
-0
lines changed Expand file tree Collapse file tree 3 files changed +543
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ library
111
111
, wai
112
112
, wai-extra
113
113
, warp
114
+ , yaml
114
115
115
116
-- Dependencies whose version is fixed by @cabal.project@ file.
116
117
build-depends :
Original file line number Diff line number Diff line change @@ -6,9 +6,11 @@ module GeniusYield.Server.Options where
6
6
import Control.Exception (SomeException (.. ), displayException , try )
7
7
import Control.Monad.Trans.Except
8
8
import Data.Aeson.Encode.Pretty (encodePretty )
9
+ import Data.ByteString qualified as B
9
10
import Data.ByteString.Lazy.Char8 qualified as BL8
10
11
import Data.Text.Lazy qualified as LT
11
12
import Data.Version (showVersion )
13
+ import Data.Yaml.Pretty qualified as Yaml
12
14
import Fmt
13
15
import GeniusYield.GYConfig
14
16
import GeniusYield.HTTP.Errors
@@ -81,6 +83,7 @@ runServeCommand (ServeCommand cfp mt) = do
81
83
logInfoS $ " GeniusYield server version: " +| showVersion PackageInfo. version |+ " \n Commit used: " +| gitHash |+ " "
82
84
-- TODO: Are the directories where these files are written fine?
83
85
BL8. writeFile " web/swagger/api.json" (encodePretty geniusYieldAPISwagger)
86
+ B. writeFile " web/swagger/api.yaml" (Yaml. encodePretty Yaml. defConfig geniusYieldAPISwagger)
84
87
writeJSForAPI geniusYieldAPI vanillaJS " web/dist/api.js"
85
88
reqLoggerMiddleware ← gcpReqLogger
86
89
let
You can’t perform that action at this time.
0 commit comments