File: //opt/go/pkg/mod/github.com/go-openapi/
[email protected]/fixtures/json/models/modelWithComposition.json
{
"definitions": {
"Cat": {
"description": "A representation of a cat",
"allOf": [
{ "$ref": "#/models/Pet" },
{
"properties": {
"huntingSkill": {
"type": "string",
"description": "The measured skill for hunting",
"default": "lazy",
"enum": ["clueless", "lazy", "adventerous", "aggressive"]
}
},
"required": [ "huntingSkill" ]
}
]
},
"Dog": {
"description": "A representation of a dog",
"allOf": [
{ "$ref": "#/models/Pet" },
{
"properties": {
"packSize": {
"type": "integer",
"format": "int32",
"description": "the size of the pack the dog is from",
"default": 0,
"minimum": 0
}
},
"required": [ "name", "packSize" ]
}
]
},
"Fish": {
"description": "A representation of a fish",
"allOf": [
{ "$ref": "#/models/Pet" },
{
"properties": {
"fins": {
"type": "integer",
"format": "int32",
"description": "count of fins",
"minimum": 0
}
},
"required": [ "fins" ]
}
]
},
"Pet": {
"discriminator": "petType",
"properties": {
"name": {
"type": "string"
},
"petType": {
"type": "string"
}
},
"required": [ "name", "petType" ]
}
}
}