Skip to content

Commit 7c036d2

Browse files
committed
Updated with JSON schema validation
1 parent 331cda3 commit 7c036d2

File tree

2 files changed

+50
-43
lines changed

2 files changed

+50
-43
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,69 @@
11
{
2-
"$id": "https://virtualan.io/pets_json.schema.json",
3-
"$schema": "https://json-schema.org/draft/2020-12/schema",
4-
"title": "Pet",
5-
"description": "Pet",
6-
"required": [
7-
"id",
8-
"name"
9-
],
2+
"$schema": "http://json-schema.org/draft-04/schema#",
103
"type": "object",
114
"properties": {
5+
"photoUrls": {
6+
"type": "array",
7+
"items": [
8+
{
9+
"type": "string"
10+
}
11+
]
12+
},
1213
"name": {
1314
"type": "string"
1415
},
1516
"id": {
1617
"type": "integer"
1718
},
18-
"status": {
19-
"type": "string"
20-
},
21-
"category": {
22-
"type": "object",
23-
"$ref": "#/$defs/category"
24-
},
25-
"tags": {
26-
"type": "array",
27-
"items": {
28-
"$ref": "#/$defs/tag"
29-
}
30-
},
31-
"photoUrls": {
32-
"type": "array",
33-
"items": {
34-
"type": "string"
35-
}
36-
}
37-
},
38-
"$defs": {
3919
"category": {
4020
"type": "object",
4121
"properties": {
42-
"id": {
43-
"type": "integer"
44-
},
4522
"name": {
4623
"type": "string"
47-
}
48-
}
49-
},
50-
"tag": {
51-
"type": "object",
52-
"properties": {
24+
},
5325
"id": {
5426
"type": "integer"
55-
},
56-
"name": {
57-
"type": "string"
5827
}
59-
}
28+
},
29+
"required": [
30+
"name",
31+
"id"
32+
]
33+
},
34+
"status": {
35+
"type": "string"
36+
},
37+
"status1": {
38+
"type": "string"
39+
},
40+
"tags": {
41+
"type": "array",
42+
"items": [
43+
{
44+
"type": "object",
45+
"properties": {
46+
"name": {
47+
"type": "string"
48+
},
49+
"id": {
50+
"type": "integer"
51+
}
52+
},
53+
"required": [
54+
"name",
55+
"id"
56+
]
57+
}
58+
]
6059
}
61-
}
60+
},
61+
"required": [
62+
"photoUrls",
63+
"name",
64+
"id",
65+
"category",
66+
"status",
67+
"tags"
68+
]
6269
}
1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)