git.iko.soy/typeable/openapi3
on master help sign in
Add Schema object test - Model with Map/Dictionary Properties
677e1beNickolay Kudasov
test/Data/SwaggerSpec.hs+17
@@ -44,6 +44,7 @@ spec = do
44 describe "Schema Object" $ do
44 describe "Schema Object" $ do
45 context "Primitive Sample" $ schemaPrimitiveExample <~> schemaPrimitiveExampleJSON
45 context "Primitive Sample" $ schemaPrimitiveExample <~> schemaPrimitiveExampleJSON
46 context "Simple Model" $ schemaSimpleModelExample <~> schemaSimpleModelExampleJSON
46 context "Simple Model" $ schemaSimpleModelExample <~> schemaSimpleModelExampleJSON
47+ context "Model with Map/Dictionary Properties" $ schemaModelDictExample <~> schemaModelDictExampleJSON
47
48
48main :: IO ()
49main :: IO ()
49main = hspec spec
50main = hspec spec
@@ -276,3 +277,19 @@ schemaSimpleModelExampleJSON = [aesonQQ|
276 }
277 }
277}
278}
278|]
279|]
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+|]