gonito/Handler/Swagger.hs
2021-02-15 13:48:58 +01:00

28 lines
651 B
Haskell

module Handler.Swagger where
import Import
import Data.Swagger
import Handler.ListChallenges
import Handler.ShowChallenge
import Handler.Query
import Control.Lens hiding ((.=))
getSwaggerR :: Handler Value
getSwaggerR = return $ toJSON apiDescription
apiDescription :: Swagger
apiDescription = generalApi
<> listChallengesApi
<> leaderboardApi
<> allSubmissionsApi
<> mySubmissionsApi
<> challengeReadmeInMarkdownApi
<> queryApi
generalApi :: Swagger
generalApi = (mempty :: Swagger)
& info .~ (mempty &
title .~ "Gonito API")