Skip to content

Commit f4e924e

Browse files
committed
Beheer: voeg linter regel toe voor invalid-input
Die is per abuis verwijderd in 616fe47 terwijl die er wel in had gemoeten. Tevens fixt het een klein issue waar `openapi.yaml` niet goed werden genegeerd, zoals we al deden voor `openapi.json`.
1 parent ee87e3a commit f4e924e

6 files changed

Lines changed: 438 additions & 1 deletion

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-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+
}

linter/testcases/paths-kebab-variables/openapi.json

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,36 @@
5555
}
5656
}
5757
}
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": "array",
71+
"items": {
72+
"type": "object",
73+
"properties": {
74+
"in": { "type": "string" },
75+
"location": { "type": "string" },
76+
"code": { "type": "string" },
77+
"detail": { "type": "string" },
78+
"index": { "type": "number" }
79+
}
80+
}
81+
}
82+
},
83+
"required": ["status", "title", "detail", "errors"],
84+
"additionalProperties": false
85+
}
86+
}
87+
}
5888
}
5989
},
6090
"security": [
@@ -96,6 +126,36 @@
96126
}
97127
}
98128
}
129+
},
130+
"400": {
131+
"description": "OK",
132+
"content": {
133+
"application/problem+json": {
134+
"schema": {
135+
"type": "object",
136+
"properties": {
137+
"status": { "type": "integer" },
138+
"title": { "type": "string" },
139+
"detail": { "type": "string" },
140+
"errors": {
141+
"type": "array",
142+
"items": {
143+
"type": "object",
144+
"properties": {
145+
"in": { "type": "string" },
146+
"location": { "type": "string" },
147+
"code": { "type": "string" },
148+
"detail": { "type": "string" },
149+
"index": { "type": "number" }
150+
}
151+
}
152+
}
153+
},
154+
"required": ["status", "title", "detail", "errors"],
155+
"additionalProperties": false
156+
}
157+
}
158+
}
99159
}
100160
},
101161
"security": [
@@ -137,6 +197,36 @@
137197
}
138198
}
139199
}
200+
},
201+
"400": {
202+
"description": "OK",
203+
"content": {
204+
"application/problem+json": {
205+
"schema": {
206+
"type": "object",
207+
"properties": {
208+
"status": { "type": "integer" },
209+
"title": { "type": "string" },
210+
"detail": { "type": "string" },
211+
"errors": {
212+
"type": "array",
213+
"items": {
214+
"type": "object",
215+
"properties": {
216+
"in": { "type": "string" },
217+
"location": { "type": "string" },
218+
"code": { "type": "string" },
219+
"detail": { "type": "string" },
220+
"index": { "type": "number" }
221+
}
222+
}
223+
}
224+
},
225+
"required": ["status", "title", "detail", "errors"],
226+
"additionalProperties": false
227+
}
228+
}
229+
}
140230
}
141231
},
142232
"security": [
@@ -178,6 +268,36 @@
178268
}
179269
}
180270
}
271+
},
272+
"400": {
273+
"description": "OK",
274+
"content": {
275+
"application/problem+json": {
276+
"schema": {
277+
"type": "object",
278+
"properties": {
279+
"status": { "type": "integer" },
280+
"title": { "type": "string" },
281+
"detail": { "type": "string" },
282+
"errors": {
283+
"type": "array",
284+
"items": {
285+
"type": "object",
286+
"properties": {
287+
"in": { "type": "string" },
288+
"location": { "type": "string" },
289+
"code": { "type": "string" },
290+
"detail": { "type": "string" },
291+
"index": { "type": "number" }
292+
}
293+
}
294+
}
295+
},
296+
"required": ["status", "title", "detail", "errors"],
297+
"additionalProperties": false
298+
}
299+
}
300+
}
181301
}
182302
},
183303
"security": [

0 commit comments

Comments
 (0)