forked from filipg/gonito
Fix Swagger
This commit is contained in:
parent
106e076bc8
commit
64a5bd52be
@ -70,7 +70,7 @@ instance ToJSON Parameter where
|
|||||||
instance ToSchema Parameter where
|
instance ToSchema Parameter where
|
||||||
declareNamedSchema _ = do
|
declareNamedSchema _ = do
|
||||||
stringSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy String)
|
stringSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy String)
|
||||||
return $ NamedSchema (Just "SubmissionInfo") $ mempty
|
return $ NamedSchema (Just "Parameter") $ mempty
|
||||||
& type_ .~ SwaggerObject
|
& type_ .~ SwaggerObject
|
||||||
& properties .~
|
& properties .~
|
||||||
fromList [ ("name", stringSchema),
|
fromList [ ("name", stringSchema),
|
||||||
@ -92,7 +92,7 @@ instance ToSchema VariantView where
|
|||||||
stringSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [String])
|
stringSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [String])
|
||||||
evaluationsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [EvaluationView])
|
evaluationsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [EvaluationView])
|
||||||
paramsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [Parameter])
|
paramsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [Parameter])
|
||||||
return $ NamedSchema (Just "SubmissionInfo") $ mempty
|
return $ NamedSchema (Just "Variant") $ mempty
|
||||||
& type_ .~ SwaggerObject
|
& type_ .~ SwaggerObject
|
||||||
& properties .~
|
& properties .~
|
||||||
fromList [ ("id", intSchema),
|
fromList [ ("id", intSchema),
|
||||||
@ -117,7 +117,7 @@ instance ToSchema QueryResultView where
|
|||||||
declareNamedSchema _ = do
|
declareNamedSchema _ = do
|
||||||
submissionInfoSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy FullSubmissionInfo)
|
submissionInfoSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy FullSubmissionInfo)
|
||||||
variantViewsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [VariantView])
|
variantViewsSchema <- declareSchemaRef (DPR.Proxy :: DPR.Proxy [VariantView])
|
||||||
return $ NamedSchema (Just "SubmissionInfo") $ mempty
|
return $ NamedSchema (Just "QueryResult") $ mempty
|
||||||
& type_ .~ SwaggerObject
|
& type_ .~ SwaggerObject
|
||||||
& properties .~
|
& properties .~
|
||||||
fromList [ ("submissionInfo", submissionInfoSchema),
|
fromList [ ("submissionInfo", submissionInfoSchema),
|
||||||
@ -334,7 +334,7 @@ declareQuerySwagger = do
|
|||||||
queryApi :: Swagger
|
queryApi :: Swagger
|
||||||
queryApi = spec & definitions .~ defs
|
queryApi = spec & definitions .~ defs
|
||||||
where
|
where
|
||||||
(defs, spec) = runDeclare declareLeaderboardSwagger mempty
|
(defs, spec) = runDeclare declareQuerySwagger mempty
|
||||||
|
|
||||||
|
|
||||||
priorityLimitForViewVariant :: Int
|
priorityLimitForViewVariant :: Int
|
||||||
|
@ -5,6 +5,7 @@ import Import
|
|||||||
import Data.Swagger
|
import Data.Swagger
|
||||||
import Handler.ListChallenges
|
import Handler.ListChallenges
|
||||||
import Handler.ShowChallenge
|
import Handler.ShowChallenge
|
||||||
|
import Handler.Query
|
||||||
|
|
||||||
import Control.Lens hiding ((.=))
|
import Control.Lens hiding ((.=))
|
||||||
|
|
||||||
@ -18,6 +19,7 @@ apiDescription = generalApi
|
|||||||
<> allSubmissionsApi
|
<> allSubmissionsApi
|
||||||
<> mySubmissionsApi
|
<> mySubmissionsApi
|
||||||
<> challengeReadmeInMarkdownApi
|
<> challengeReadmeInMarkdownApi
|
||||||
|
<> queryApi
|
||||||
|
|
||||||
generalApi :: Swagger
|
generalApi :: Swagger
|
||||||
generalApi = (mempty :: Swagger)
|
generalApi = (mempty :: Swagger)
|
||||||
|
Loading…
Reference in New Issue
Block a user