forked from filipg/gonito
Fix weird compilation error
This commit is contained in:
parent
648a4368d0
commit
d44408c1e8
@ -1,5 +1,3 @@
|
|||||||
{-# LANGUAGE OverloadedLists #-}
|
|
||||||
|
|
||||||
module Handler.ShowChallenge where
|
module Handler.ShowChallenge where
|
||||||
|
|
||||||
import Import hiding (Proxy, fromList)
|
import Import hiding (Proxy, fromList)
|
||||||
@ -66,7 +64,7 @@ import qualified Data.Swagger as DS
|
|||||||
|
|
||||||
import Data.Swagger.Declare
|
import Data.Swagger.Declare
|
||||||
import Control.Lens hiding ((.=), (^.))
|
import Control.Lens hiding ((.=), (^.))
|
||||||
import Data.Proxy
|
import Data.Proxy as DPR
|
||||||
import Data.HashMap.Strict.InsOrd (fromList)
|
import Data.HashMap.Strict.InsOrd (fromList)
|
||||||
|
|
||||||
instance ToJSON LeaderboardEntry where
|
instance ToJSON LeaderboardEntry where
|
||||||
@ -82,8 +80,8 @@ instance ToJSON LeaderboardEntry where
|
|||||||
|
|
||||||
instance ToSchema LeaderboardEntry where
|
instance ToSchema LeaderboardEntry where
|
||||||
declareNamedSchema _ = do
|
declareNamedSchema _ = do
|
||||||
stringSchema <- declareSchemaRef (Proxy :: Proxy String)
|
stringSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy String)
|
||||||
intSchema <- declareSchemaRef (Proxy :: Proxy Int)
|
intSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy Int)
|
||||||
return $ NamedSchema (Just "LeaderboardEntry") $ mempty
|
return $ NamedSchema (Just "LeaderboardEntry") $ mempty
|
||||||
& type_ .~ SwaggerObject
|
& type_ .~ SwaggerObject
|
||||||
& properties .~
|
& properties .~
|
||||||
@ -105,18 +103,18 @@ declareLeaderboardSwagger = do
|
|||||||
|
|
||||||
return $ mempty
|
return $ mempty
|
||||||
& paths .~
|
& paths .~
|
||||||
[ ("/api/leaderboard/{challengeName}",
|
fromList [ ("/api/leaderboard/{challengeName}",
|
||||||
mempty & DS.get ?~ (mempty
|
mempty & DS.get ?~ (mempty
|
||||||
& parameters .~ [ Inline $ mempty
|
& parameters .~ [ Inline $ mempty
|
||||||
& name .~ "challengeName"
|
& name .~ "challengeName"
|
||||||
& required ?~ True
|
& required ?~ True
|
||||||
& schema .~ ParamOther (mempty
|
& schema .~ ParamOther (mempty
|
||||||
& in_ .~ ParamPath
|
& in_ .~ ParamPath
|
||||||
& paramSchema .~ challengeNameSchema) ]
|
& paramSchema .~ challengeNameSchema) ]
|
||||||
& produces ?~ MimeList ["application/json"]
|
& produces ?~ MimeList ["application/json"]
|
||||||
& description ?~ "Returns a leaderboard for a given challenge"
|
& description ?~ "Returns a leaderboard for a given challenge"
|
||||||
& at 200 ?~ Inline leaderboardResponse))
|
& at 200 ?~ Inline leaderboardResponse))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
leaderboardApi :: Swagger
|
leaderboardApi :: Swagger
|
||||||
|
Loading…
Reference in New Issue
Block a user