-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema-validator.postman_collection.json
147 lines (147 loc) · 9.22 KB
/
schema-validator.postman_collection.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
{
"info": {
"_postman_id": "ef25d62a-f641-48a1-8d6d-16bec704cb09",
"name": "schema-validator",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "22519036"
},
"item": [
{
"name": "localhost:8123/api/validate",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"schema\": {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"type\": \"object\",\n \"properties\": {\n \"BusinessServiceConfig\": {\n \"$ref\": \"#/definitions/BusinessServiceConfigData\"\n }\n },\n \"required\": [\n \"BusinessServiceConfig\"\n ],\n \"title\": \"BusinessServiceConfigData\",\n \"definitions\": {\n \"BusinessServiceConfigData\": {\n \"type\": \"object\",\n \"properties\": {\n \"tenantId\": {\n \"type\": \"string\"\n },\n \"moduleName\": {\n \"type\": \"string\"\n },\n \"BusinessService\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"businessService\": {\n \"type\": \"string\"\n },\n \"code\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\n \"businessService\",\n \"code\"\n ]\n }\n }\n },\n \"required\": [\n \"BusinessService\",\n \"moduleName\",\n \"tenantId\"\n ]\n }\n }\n },\n \"data\": {\n \"BusinessServiceConfig\": {\n \"tenantId\": \"statea\",\n \"moduleName\": \"expense\",\n \"BusinessService\": [\n {\n \"businessService\": \"works.wages\",\n \"code\": \"EXPENSE.WAGES\"\n },\n {\n \"businessService\": \"works.purchase\",\n \"code\": \"EXPENSE.PURCHASE\"\n },\n {\n \"businessService\": \"works.supervision\",\n \"code\": \"EXPENSE.SUPERVISION\"\n },\n {\n \"businessService\": \"contract\",\n \"code\": \"CONTRACT\"\n },\n {\n \"businessService\": \"muster roll\",\n \"code\": \"MR\"\n },\n {\n \"businessService\": \"estimate\",\n \"code\": \"ESTIMATE\"\n }\n ]\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8123/api/validate",
"host": [
"localhost"
],
"port": "8123",
"path": [
"api",
"validate"
]
}
},
"response": [
{
"name": "Valid Schema and Data",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"schema\": {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"$id\": \"https://example.com/employee.schema.json\",\n \"title\": \"Record of employee\",\n \"description\": \"This document records the details of an employee\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"description\": \"A unique identifier for an employee\",\n \"type\": \"number\"\n },\n \"name\": {\n \"description\": \"Full name of the employee\",\n \"type\": \"string\"\n },\n \"age\": {\n \"description\": \"Age of the employee\",\n \"type\": \"number\"\n },\n \"hobbies\": {\n \"description\": \"Hobbies of the employee\",\n \"type\": \"object\",\n \"properties\": {\n \"indoor\": {\n \"type\": \"array\",\n \"items\": {\n \"description\": \"List of indoor hobbies\",\n \"type\": \"string\"\n }\n },\n \"outdoor\": {\n \"type\": \"array\",\n \"items\": {\n \"description\": \"List of outdoor hobbies\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"data\": {\n \"id\": 7,\n \"name\": \"John Doe\",\n \"age\": 22,\n \"hobbies\": {\n \"indoor\": [\n \"Chess\"\n ],\n \"outdoor\": [\n \"BasketballStand-up Comedy\"\n ]\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8123/api/validate",
"host": [
"localhost"
],
"port": "8123",
"path": [
"api",
"validate"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Date",
"value": "Tue, 06 Jun 2023 19:21:00 GMT"
},
{
"key": "Keep-Alive",
"value": "timeout=60"
},
{
"key": "Connection",
"value": "keep-alive"
}
],
"cookie": [],
"body": "{\n \"is_valid\": true,\n \"message\": \"Correct\"\n}"
},
{
"name": "Invalid data",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"schema\": {\n \"$schema\": \"http://json-schema.org/draft-07/schema\",\n \"$id\": \"https://example.com/employee.schema.json\",\n \"title\": \"Record of employee\",\n \"description\": \"This document records the details of an employee\",\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"description\": \"A unique identifier for an employee\",\n \"type\": \"number\"\n },\n \"name\": {\n \"description\": \"Full name of the employee\",\n \"type\": \"string\"\n },\n \"age\": {\n \"description\": \"Age of the employee\",\n \"type\": \"number\"\n },\n \"hobbies\": {\n \"description\": \"Hobbies of the employee\",\n \"type\": \"object\",\n \"properties\": {\n \"indoor\": {\n \"type\": \"array\",\n \"items\": {\n \"description\": \"List of indoor hobbies\",\n \"type\": \"string\"\n }\n },\n \"outdoor\": {\n \"type\": \"array\",\n \"items\": {\n \"description\": \"List of outdoor hobbies\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n },\n \"data\": {\n \"id\": 7,\n \"name\": \"John Doe\",\n \"age\": 22,\n \"hobbies\": {\n \"indoor\":{\n \"name\": \"chess\"\n },\n \"outdoor\": [\n \"BasketballStand-up Comedy\"\n ]\n }\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "localhost:8123/api/validate",
"host": [
"localhost"
],
"port": "8123",
"path": [
"api",
"validate"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Transfer-Encoding",
"value": "chunked"
},
{
"key": "Date",
"value": "Tue, 06 Jun 2023 19:23:50 GMT"
},
{
"key": "Keep-Alive",
"value": "timeout=60"
},
{
"key": "Connection",
"value": "keep-alive"
}
],
"cookie": [],
"body": "{\n \"is_valid\": false,\n \"message\": \"#/hobbies/indoor: expected type: JSONArray, found: JSONObject\"\n}"
}
]
}
]
}