Add disciminator to the demo spec

This commit is contained in:
Roman Hotsiy 2016-01-09 22:35:20 +02:00
parent 26b9bbc4ae
commit 2bfb983361

View File

@ -773,7 +773,11 @@
"Pet": { "Pet": {
"type": "object", "type": "object",
"required": ["name", "photoUrls"], "required": ["name", "photoUrls"],
"discriminator": "petType",
"properties": { "properties": {
"petType": {
"type": "string"
},
"id": { "id": {
"type": "integer", "type": "integer",
"format": "int64" "format": "int64"
@ -815,6 +819,56 @@
"name": "Pet" "name": "Pet"
} }
}, },
"Cat": {
"description": "A representation of a cat",
"allOf": [
{
"$ref": "#/definitions/Pet"
},
{
"type": "object",
"properties": {
"huntingSkill": {
"type": "string",
"description": "The measured skill for hunting",
"default": "lazy",
"enum": [
"clueless",
"lazy",
"adventurous",
"aggressive"
]
}
},
"required": [
"huntingSkill"
]
}
]
},
"Dog": {
"description": "A representation of a dog",
"allOf": [
{
"$ref": "#/definitions/Pet"
},
{
"type": "object",
"properties": {
"packSize": {
"type": "integer",
"format": "int32",
"description": "the size of the pack the dog is from",
"default": 0,
"minimum": 0
}
},
"required": [
"packSize"
]
}
]
},
"ApiResponse": { "ApiResponse": {
"type": "object", "type": "object",
"properties": { "properties": {