2021-01-25 06:53:37 +01:00
|
|
|
module Handler.Swagger where
|
|
|
|
|
|
|
|
import Import
|
|
|
|
|
|
|
|
import Data.Swagger
|
|
|
|
import Handler.ListChallenges
|
|
|
|
import Handler.ShowChallenge
|
2021-02-15 13:48:58 +01:00
|
|
|
import Handler.Query
|
2021-01-25 06:53:37 +01:00
|
|
|
|
|
|
|
import Control.Lens hiding ((.=))
|
|
|
|
|
|
|
|
getSwaggerR :: Handler Value
|
|
|
|
getSwaggerR = return $ toJSON apiDescription
|
|
|
|
|
|
|
|
apiDescription :: Swagger
|
2021-02-08 12:27:44 +01:00
|
|
|
apiDescription = generalApi
|
|
|
|
<> listChallengesApi
|
|
|
|
<> leaderboardApi
|
|
|
|
<> allSubmissionsApi
|
|
|
|
<> mySubmissionsApi
|
|
|
|
<> challengeReadmeInMarkdownApi
|
2021-02-15 13:48:58 +01:00
|
|
|
<> queryApi
|
2021-01-25 06:53:37 +01:00
|
|
|
|
|
|
|
generalApi :: Swagger
|
|
|
|
generalApi = (mempty :: Swagger)
|
|
|
|
& info .~ (mempty &
|
|
|
|
title .~ "Gonito API")
|