git.iko.soy/typeable/swagger2
on master help sign in
Add Schema object test - Model with Map/Dictionary Properties
commit677e1be8b0f82082a2ff275b28247c1824744193 authorNickolay Kudasov <nickolay.kudasov@gmail.com> dateSun 8 Nov 2015, 16:43 (11 years ago) parent3e6fcfb
1 file changed+17
test/Data/SwaggerSpec.hs+17
test/Data/SwaggerSpec.hs+17
@@ -44,6 +44,7 @@ spec = do
4444 describe "Schema Object" $ do
4545 context "Primitive Sample" $ schemaPrimitiveExample <~> schemaPrimitiveExampleJSON
4646 context "Simple Model" $ schemaSimpleModelExample <~> schemaSimpleModelExampleJSON
47+ context "Model with Map/Dictionary Properties" $ schemaModelDictExample <~> schemaModelDictExampleJSON
4748
4849main :: IO ()
4950main = hspec spec
@@ -276,3 +277,19 @@ schemaSimpleModelExampleJSON = [aesonQQ|
276277 }
277278}
278279|]
280+
281+schemaModelDictExample :: SwaggerSchema
282+schemaModelDictExample = mempty
283+ { swaggerSchemaType = SwaggerSchemaObject
284+ , swaggerSchemaAdditionalProperties = Just mempty
285+ { swaggerSchemaType = SwaggerSchemaString } }
286+
287+schemaModelDictExampleJSON :: Value
288+schemaModelDictExampleJSON = [aesonQQ|
289+{
290+ "type": "object",
291+ "additionalProperties": {
292+ "type": "string"
293+ }
294+}
295+|]