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-03-11 21:23:18 +01:00
|
|
|
import Handler.Tags
|
2021-03-11 22:27:22 +01:00
|
|
|
import Handler.Team
|
2021-03-11 21:23:18 +01:00
|
|
|
|
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
|
2021-04-27 11:49:22 +02:00
|
|
|
<> addUserApi
|
|
|
|
<> userInfoApi
|
2021-08-31 22:36:10 +02:00
|
|
|
<> myEvaluationTriggerTokenApi
|
2021-02-08 12:27:44 +01:00
|
|
|
<> listChallengesApi
|
|
|
|
<> leaderboardApi
|
|
|
|
<> allSubmissionsApi
|
|
|
|
<> mySubmissionsApi
|
|
|
|
<> challengeReadmeInMarkdownApi
|
2021-02-15 13:48:58 +01:00
|
|
|
<> queryApi
|
2021-02-15 21:35:09 +01:00
|
|
|
<> challengeSubmissionApi
|
2021-09-15 13:10:44 +02:00
|
|
|
<> makePublicApi
|
2021-02-24 14:11:30 +01:00
|
|
|
<> versionInfoApi
|
2021-03-11 21:23:18 +01:00
|
|
|
<> listTagsApi
|
2021-03-11 22:27:22 +01:00
|
|
|
<> myTeamsApi
|
2021-05-28 07:17:45 +02:00
|
|
|
<> challengeImgApi
|
2021-06-16 08:49:50 +02:00
|
|
|
<> challengeRepoApi
|
2021-07-30 12:19:27 +02:00
|
|
|
<> testProgressApi
|
|
|
|
<> viewProgressWithWebSockets
|
2021-08-09 22:19:40 +02:00
|
|
|
<> viewProgressLog
|
2021-09-02 22:38:59 +02:00
|
|
|
<> currentTimeApi
|
|
|
|
<> formatAsLocalTimeApi
|
2021-01-25 06:53:37 +01:00
|
|
|
|
|
|
|
generalApi :: Swagger
|
|
|
|
generalApi = (mempty :: Swagger)
|
|
|
|
& info .~ (mempty &
|
2021-02-15 20:45:45 +01:00
|
|
|
title .~ "Gonito API" &
|
2021-09-25 21:24:14 +02:00
|
|
|
version .~ "3.11.0")
|