Skip to content

Commit

Permalink
Merge pull request #14 from fehguy/master
Browse files Browse the repository at this point in the history
added subtype model
  • Loading branch information
fehguy committed Jun 20, 2014
2 parents 52cb19a + 0311038 commit dc831f7
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions samples/v2.0/json/04-models-with-subtypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"models": {
"Cat": {
"description": "A representation of a cat",
"required": [
"huntingSkill"
],
"properties": {
"huntingSkill": {
"type": "string",
"description": "The measured skill for hunting",
"default": "lazy",
"enum": [
"clueless",
"lazy",
"adventerous",
"aggressive"
]
}
}
},
"Dog": {
"description": "A representation of a dog",
"required": [
"packSize"
],
"properties": {
"packSize": {
"type": "integer",
"format": "int32",
"description": "the size of the pack the dog is from",
"default": 0,
"min": 0
}
}
},
"Pet": {
"subTypes": [
"Cat",
"Dog"
],
"discriminator": "animalType",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
}
}
}
}
}

0 comments on commit dc831f7

Please sign in to comment.