@@ -42,6 +42,7 @@ spec = do
4242 describe "Parameters Definition Object" $ paramsDefinitionExample <=> paramsDefinitionExampleJSON
4343 describe "Responses Definition Object" $ responsesDefinitionExample <=> responsesDefinitionExampleJSON
4444 describe "Security Definitions Object" $ securityDefinitionsExample <=> securityDefinitionsExampleJSON
45+ describe "Composition Schema Example" $ compositionSchemaExample <=> compositionSchemaExampleJSON
4546 describe "Swagger Object" $ do
4647 context "Todo Example" $ swaggerExample <=> swaggerExampleJSON
4748 context "PetStore Example" $
@@ -1614,3 +1615,33 @@ petstoreExampleJSON = [aesonQQ|
16141615 }
16151616}
16161617|]
1618+
1619+compositionSchemaExample :: Schema
1620+compositionSchemaExample = mempty
1621+ & type_ .~ SwaggerObject
1622+ & Data.Swagger.allOf ?~ [
1623+ Ref (Reference "Other")
1624+ , Inline (mempty
1625+ & type_ .~ SwaggerObject
1626+ & properties .~
1627+ [ ("greet", Inline $ mempty
1628+ & type_ .~ SwaggerString) ])
1629+ ]
1630+
1631+compositionSchemaExampleJSON :: Value
1632+compositionSchemaExampleJSON = [aesonQQ|
1633+{
1634+ "type": "object",
1635+ "allOf": [
1636+ {
1637+ "$ref": "#/definitions/Other"
1638+ },
1639+ {
1640+ "type": "object",
1641+ "properties": {
1642+ "greet": { "type": "string" }
1643+ }
1644+ }
1645+ ]
1646+}
1647+|]