-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: we don't have documentation for our `coffer Web API`. Solution: added executable `coffer-swagger-api` which generates Swagger docs.
- Loading branch information
Showing
10 changed files
with
217 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io> | ||
-- | ||
-- SPDX-License-Identifier: MPL-2.0 | ||
|
||
module Main where | ||
|
||
import Control.Lens | ||
import Data.Aeson.Encode.Pretty (encodePretty) | ||
import Data.ByteString.Lazy.Char8 qualified as BL | ||
import Data.Data (Proxy(Proxy)) | ||
import Data.OpenApi | ||
import Servant.OpenApi (toOpenApi) | ||
import Web.API (API) | ||
|
||
main :: IO () | ||
main = do | ||
let openApi = toOpenApi (Proxy :: Proxy API) | ||
& info . title .~ "Coffer Web API" | ||
& info . version .~ "1.0" | ||
& servers .~ ["localhost:8081"] | ||
BL.writeFile "swagger.json" (encodePretty openApi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.