Skip to content

Commit dc831f7

Browse files
committed
Merge pull request #14 from fehguy/master
added subtype model
2 parents 52cb19a + 0311038 commit dc831f7

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

Diff for: samples/v2.0/json/04-models-with-subtypes.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"models": {
3+
"Cat": {
4+
"description": "A representation of a cat",
5+
"required": [
6+
"huntingSkill"
7+
],
8+
"properties": {
9+
"huntingSkill": {
10+
"type": "string",
11+
"description": "The measured skill for hunting",
12+
"default": "lazy",
13+
"enum": [
14+
"clueless",
15+
"lazy",
16+
"adventerous",
17+
"aggressive"
18+
]
19+
}
20+
}
21+
},
22+
"Dog": {
23+
"description": "A representation of a dog",
24+
"required": [
25+
"packSize"
26+
],
27+
"properties": {
28+
"packSize": {
29+
"type": "integer",
30+
"format": "int32",
31+
"description": "the size of the pack the dog is from",
32+
"default": 0,
33+
"min": 0
34+
}
35+
}
36+
},
37+
"Pet": {
38+
"subTypes": [
39+
"Cat",
40+
"Dog"
41+
],
42+
"discriminator": "animalType",
43+
"required": [
44+
"name"
45+
],
46+
"properties": {
47+
"name": {
48+
"type": "string"
49+
}
50+
}
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)