|
2 | 2 | "models": {
|
3 | 3 | "Cat": {"$ref": "#/definitions/cat"},
|
4 | 4 | "Dog": {"$ref": "#/definitions/dog"},
|
| 5 | + "Fish": {"$ref": "#/definitions/fish"}, |
5 | 6 | "Pet": {"$ref": "#/definitions/pet"}
|
6 | 7 | },
|
7 | 8 | "definitions": {
|
8 | 9 | "pet": {
|
9 |
| - "required": [ |
10 |
| - "name" |
11 |
| - ], |
| 10 | + "required": [ "name" ], |
12 | 11 | "properties": {
|
13 | 12 | "name": {
|
14 | 13 | "type": "string"
|
|
17 | 16 | },
|
18 | 17 | "cat": {
|
19 | 18 | "description": "A representation of a cat",
|
20 |
| - "allOf": [{ |
21 |
| - "$ref": "#/definitions/pet", |
22 |
| - "huntingSkill": { |
23 |
| - "type": "string", |
24 |
| - "description": "The measured skill for hunting", |
25 |
| - "default": "lazy", |
26 |
| - "enum": [ |
27 |
| - "clueless", |
28 |
| - "lazy", |
29 |
| - "adventerous", |
30 |
| - "aggressive" |
31 |
| - ] |
| 19 | + "allOf": [ |
| 20 | + { |
| 21 | + "$ref": "#/definitions/pet" |
32 | 22 | },
|
33 |
| - "required": [ |
34 |
| - "huntingSkill" |
35 |
| - ] |
36 |
| - }] |
| 23 | + { |
| 24 | + "huntingSkill": { |
| 25 | + "type": "string", |
| 26 | + "description": "The measured skill for hunting", |
| 27 | + "default": "lazy", |
| 28 | + "enum": ["clueless", "lazy", "adventerous", "aggressive"] |
| 29 | + }, |
| 30 | + "required": [ "huntingSkill" ] |
| 31 | + } |
| 32 | + ], |
| 33 | + "extends": { |
| 34 | + "$ref": "#/definitions/pet" |
| 35 | + } |
37 | 36 | },
|
38 | 37 | "dog": {
|
39 | 38 | "description": "A representation of a dog",
|
40 |
| - "allOf": [{ |
41 |
| - "$ref": "#/definitions/pet", |
42 |
| - "required": [ |
43 |
| - "packSize" |
44 |
| - ], |
| 39 | + "properties": [ |
| 40 | + "name": { |
| 41 | + "type": "string" |
| 42 | + }, |
45 | 43 | "packSize": {
|
46 | 44 | "type": "integer",
|
47 | 45 | "format": "int32",
|
48 | 46 | "description": "the size of the pack the dog is from",
|
49 | 47 | "default": 0,
|
50 | 48 | "min": 0
|
51 | 49 | }
|
52 |
| - }] |
| 50 | + ], |
| 51 | + "required": [ "name", "packSize" ], |
| 52 | + "additionalAttributes": false, |
| 53 | + "extends": { |
| 54 | + "$ref": "#/definitions/pet" |
| 55 | + } |
| 56 | + }, |
| 57 | + "fish": { |
| 58 | + "description": "A representation of a fish", |
| 59 | + "allOf": [ |
| 60 | + { |
| 61 | + "$ref": "#/definitions/pet" |
| 62 | + } |
| 63 | + ], |
| 64 | + "properties": [ |
| 65 | + "fins": { |
| 66 | + "type": "integer", |
| 67 | + "format": "int32", |
| 68 | + "description": "count of fins", |
| 69 | + "min": 0 |
| 70 | + } |
| 71 | + ], |
| 72 | + "required": [ "fins" ], |
| 73 | + "extends": { |
| 74 | + "$ref": "#/definitions/pet" |
| 75 | + } |
53 | 76 | }
|
54 | 77 | }
|
55 | 78 | }
|
0 commit comments