@@ -45,6 +45,7 @@ spec = 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 context "Model with Map/Dictionary Properties" $ schemaModelDictExample <~> schemaModelDictExampleJSON
48+ context "Model with Example" $ schemaWithExampleExample <~> schemaWithExampleExampleJSON
49main :: IO ()
50main :: IO ()
50main = hspec spec
51main = hspec spec
@@ -293,3 +294,43 @@ schemaModelDictExampleJSON = [aesonQQ|
298+schemaWithExampleExample :: SwaggerSchema
299+schemaWithExampleExample = mempty
300+ { swaggerSchemaType = SwaggerSchemaObject
301+ , swaggerSchemaProperties =
303+ { swaggerSchemaType = SwaggerSchemaInteger
304+ , swaggerSchemaFormat = Just "int64" })
306+ { swaggerSchemaType = SwaggerSchemaString }) ]
307+ , swaggerSchemaRequired = [ "name" ]
308+ , swaggerSchemaExample = Just [aesonQQ|
315+schemaWithExampleExampleJSON :: Value
316+schemaWithExampleExampleJSON = [aesonQQ|