git.iko.soy/typeable/openapi3
on master help sign in
Add Responses Definition object test
commit53d0e3a6b4d5479b6a3af86e7ec29bfbb9be1d7c authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSun 8 Nov 2015, 17:07 (11 years ago) parent54d6bcb
1 file changed+22
test/Data/SwaggerSpec.hs+22
test/Data/SwaggerSpec.hs+22
@@ -50,6 +50,7 @@ spec = do
5050 context "Model with Example" $ schemaWithExampleExample <~> schemaWithExampleExampleJSON
5151 describe "Definitions Object" $ definitionsExample <~> definitionsExampleJSON
5252 describe "Parameters Definition Object" $ parametersDefinitionExample <~> parametersDefinitionExampleJSON
53+ describe "Responses Definition Object" $ responsesDefinitionExample <~> responsesDefinitionExampleJSON
5354
5455main :: IO ()
5556main = hspec spec
@@ -436,3 +437,24 @@ parametersDefinitionExampleJSON = [aesonQQ|
436437 }
437438}
438439|]
440+
441+-- =======================================================================
442+-- Responses Definition object
443+-- =======================================================================
444+
445+responsesDefinitionExample :: HashMap Text SwaggerResponse
446+responsesDefinitionExample =
447+ [ ("NotFound", mempty { swaggerResponseDescription = "Entity not found." })
448+ , ("IllegalInput", mempty { swaggerResponseDescription = "Illegal input for operation." }) ]
449+
450+responsesDefinitionExampleJSON :: Value
451+responsesDefinitionExampleJSON = [aesonQQ|
452+{
453+ "NotFound": {
454+ "description": "Entity not found."
455+ },
456+ "IllegalInput": {
457+ "description": "Illegal input for operation."
458+ }
459+}
460+|]