Skip to content

Commit f735d8e

Browse files
committed
Voeg regel toe voor error structuur bij Bad Requests
Hier was initieel geen consensus voor bij de behandeling van het hoofdstuk "Error Handling".
1 parent 357e302 commit f735d8e

9 files changed

Lines changed: 700 additions & 9 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
/testcases/error-type-bad-invalid-input/openapi.json
3+
119:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.get.responses
4+
157:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.put.responses
5+
195:29 error nlgov:problem-invalid-input GET and DELETE endpoints that have parameters, and all other endpoints must be able to return a 400 response paths./invalid-response-vereist.post.responses
6+
7+
✖ 3 problems (3 errors, 0 warnings, 0 infos, 0 hints)
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
{
2+
"openapi": "3.0.3",
3+
"info": {
4+
"title": "Baseline",
5+
"description": "Deze OpenAPI specification bevat het minimale om aan alle regels te voldoen.",
6+
"contact": {
7+
"name": "Beheerder",
8+
"url": "https://www.example.com",
9+
"email": "mail@example.com"
10+
},
11+
"version": "1.0.0"
12+
},
13+
"servers": [
14+
{
15+
"url": "https://example.com/api/v1"
16+
}
17+
],
18+
"security": [
19+
{
20+
"default": []
21+
}
22+
],
23+
"tags": [
24+
{
25+
"name": "openapi"
26+
},
27+
{
28+
"name": "resource"
29+
}
30+
],
31+
"paths": {
32+
"/openapi.json": {
33+
"get": {
34+
"tags": [
35+
"openapi"
36+
],
37+
"description": "OpenAPI document",
38+
"operationId": "getOpenapiJSON",
39+
"parameters": [],
40+
"responses": {
41+
"200": {
42+
"description": "OK",
43+
"headers": {
44+
"API-Version": {
45+
"description": "De huidige versie van de applicatie",
46+
"style": "simple",
47+
"schema": {
48+
"type": "string"
49+
}
50+
},
51+
"access-control-allow-origin": {
52+
"description": "Alle origins mogen bij deze resource",
53+
"schema": {
54+
"type": "string"
55+
}
56+
}
57+
}
58+
},
59+
"400": {
60+
"description": "OK",
61+
"content": {
62+
"application/problem+json": {
63+
"schema": {
64+
"type": "object",
65+
"properties": {
66+
"status": { "type": "integer" },
67+
"title": { "type": "string" },
68+
"detail": { "type": "string" },
69+
"errors": {
70+
"type": "object",
71+
"properties": {
72+
"in": { "type": "string" },
73+
"location": {
74+
"type": "object",
75+
"properties": {
76+
"pointer": { "type": "string" },
77+
"name": { "type": "string" },
78+
"index": { "type": "integer" }
79+
}
80+
},
81+
"code": { "type": "string" },
82+
"detail": { "type": "string" }
83+
}
84+
}
85+
},
86+
"required": ["status", "title", "detail", "errors"],
87+
"additionalProperties": false
88+
}
89+
}
90+
}
91+
}
92+
},
93+
"security": [
94+
{
95+
"default": []
96+
}
97+
]
98+
}
99+
},
100+
"/invalid-response-vereist": {
101+
"get": {
102+
"tags": [
103+
"resource"
104+
],
105+
"description": "Resource",
106+
"operationId": "getPropertiesCorrect",
107+
"parameters": [
108+
{
109+
"name": "expand",
110+
"in": "query",
111+
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
112+
"schema": {
113+
"type": "boolean"
114+
},
115+
"style": "form",
116+
"explode": true
117+
}
118+
],
119+
"responses": {
120+
"200": {
121+
"description": "OK",
122+
"headers": {
123+
"API-Version": {
124+
"description": "De huidige versie van de applicatie",
125+
"style": "simple",
126+
"schema": {
127+
"type": "string"
128+
}
129+
}
130+
}
131+
}
132+
},
133+
"security": [
134+
{
135+
"default": []
136+
}
137+
]
138+
},
139+
"put": {
140+
"tags": [
141+
"resource"
142+
],
143+
"description": "Resource",
144+
"operationId": "putPropertiesCorrect",
145+
"parameters": [
146+
{
147+
"name": "expand",
148+
"in": "query",
149+
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
150+
"schema": {
151+
"type": "boolean"
152+
},
153+
"style": "form",
154+
"explode": true
155+
}
156+
],
157+
"responses": {
158+
"200": {
159+
"description": "OK",
160+
"headers": {
161+
"API-Version": {
162+
"description": "De huidige versie van de applicatie",
163+
"style": "simple",
164+
"schema": {
165+
"type": "string"
166+
}
167+
}
168+
}
169+
}
170+
},
171+
"security": [
172+
{
173+
"default": []
174+
}
175+
]
176+
},
177+
"post": {
178+
"tags": [
179+
"resource"
180+
],
181+
"description": "Resource",
182+
"operationId": "postPropertiesCorrect",
183+
"parameters": [
184+
{
185+
"name": "expand",
186+
"in": "query",
187+
"description": "Schakelaar om details van gekoppelde organisaties (subOIN of OINhouder) op te vragen (default false = geen details)",
188+
"schema": {
189+
"type": "boolean"
190+
},
191+
"style": "form",
192+
"explode": true
193+
}
194+
],
195+
"responses": {
196+
"200": {
197+
"description": "OK",
198+
"headers": {
199+
"API-Version": {
200+
"description": "De huidige versie van de applicatie",
201+
"style": "simple",
202+
"schema": {
203+
"type": "string"
204+
}
205+
}
206+
}
207+
}
208+
},
209+
"security": [
210+
{
211+
"default": []
212+
}
213+
]
214+
}
215+
}
216+
},
217+
"components": {
218+
"schemas": {
219+
},
220+
"securitySchemes": {
221+
"default": {
222+
"type": "oauth2",
223+
"flows": {
224+
"implicit": {
225+
"authorizationUrl": "https://test.com",
226+
"scopes": {}
227+
}
228+
}
229+
}
230+
}
231+
}
232+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
/testcases/error-type-bad-request/openapi.json
3+
133:58 error nlgov:problem-schema-members-bad-request Property "extra" is not expected to be here paths./properties-correct.get.responses[400].content.application/problem+json.schema.properties.errors.properties
4+
254:66 error nlgov:problem-schema-members-bad-request Property "pointer2" is not expected to be here paths./properties-location-verkeerd-format.get.responses[400].content.application/problem+json.schema.properties.errors.properties.location.properties
5+
6+
✖ 2 problems (2 errors, 0 warnings, 0 infos, 0 hints)

0 commit comments

Comments
 (0)