Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 19909e6

Browse files
committed
test(oas2): add coverage for invalid parameter (missing type or schema)
1 parent 5fc917a commit 19909e6

File tree

2 files changed

+338
-0
lines changed

2 files changed

+338
-0
lines changed
Lines changed: 329 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,329 @@
1+
{
2+
"element": "parseResult",
3+
"content": [
4+
{
5+
"element": "annotation",
6+
"meta": {
7+
"classes": {
8+
"element": "array",
9+
"content": [
10+
{
11+
"element": "string",
12+
"content": "error"
13+
}
14+
]
15+
},
16+
"links": {
17+
"element": "array",
18+
"content": [
19+
{
20+
"element": "link",
21+
"attributes": {
22+
"relation": {
23+
"element": "string",
24+
"content": "origin"
25+
},
26+
"href": {
27+
"element": "string",
28+
"content": "http://docs.apiary.io/validations/swagger#swagger-validation"
29+
}
30+
}
31+
}
32+
]
33+
}
34+
},
35+
"attributes": {
36+
"code": {
37+
"element": "number",
38+
"content": 4
39+
},
40+
"sourceMap": {
41+
"element": "array",
42+
"content": [
43+
{
44+
"element": "sourceMap",
45+
"content": [
46+
{
47+
"element": "array",
48+
"content": [
49+
{
50+
"element": "number",
51+
"attributes": {
52+
"line": {
53+
"element": "number",
54+
"content": 7
55+
},
56+
"column": {
57+
"element": "number",
58+
"content": 8
59+
}
60+
},
61+
"content": 97
62+
},
63+
{
64+
"element": "number",
65+
"attributes": {
66+
"line": {
67+
"element": "number",
68+
"content": 9
69+
},
70+
"column": {
71+
"element": "number",
72+
"content": 0
73+
}
74+
},
75+
"content": 28
76+
}
77+
]
78+
}
79+
]
80+
}
81+
]
82+
}
83+
},
84+
"content": "Data does not match any schemas from 'oneOf'"
85+
},
86+
{
87+
"element": "annotation",
88+
"meta": {
89+
"classes": {
90+
"element": "array",
91+
"content": [
92+
{
93+
"element": "string",
94+
"content": "error"
95+
}
96+
]
97+
},
98+
"links": {
99+
"element": "array",
100+
"content": [
101+
{
102+
"element": "link",
103+
"attributes": {
104+
"relation": {
105+
"element": "string",
106+
"content": "origin"
107+
},
108+
"href": {
109+
"element": "string",
110+
"content": "http://docs.apiary.io/validations/swagger#swagger-validation"
111+
}
112+
}
113+
}
114+
]
115+
}
116+
},
117+
"attributes": {
118+
"code": {
119+
"element": "number",
120+
"content": 4
121+
},
122+
"sourceMap": {
123+
"element": "array",
124+
"content": [
125+
{
126+
"element": "sourceMap",
127+
"content": [
128+
{
129+
"element": "array",
130+
"content": [
131+
{
132+
"element": "number",
133+
"attributes": {
134+
"line": {
135+
"element": "number",
136+
"content": 7
137+
},
138+
"column": {
139+
"element": "number",
140+
"content": 8
141+
}
142+
},
143+
"content": 97
144+
},
145+
{
146+
"element": "number",
147+
"attributes": {
148+
"line": {
149+
"element": "number",
150+
"content": 9
151+
},
152+
"column": {
153+
"element": "number",
154+
"content": 0
155+
}
156+
},
157+
"content": 28
158+
}
159+
]
160+
}
161+
]
162+
}
163+
]
164+
}
165+
},
166+
"content": "Data does not match any schemas from 'oneOf'"
167+
},
168+
{
169+
"element": "annotation",
170+
"meta": {
171+
"classes": {
172+
"element": "array",
173+
"content": [
174+
{
175+
"element": "string",
176+
"content": "error"
177+
}
178+
]
179+
},
180+
"links": {
181+
"element": "array",
182+
"content": [
183+
{
184+
"element": "link",
185+
"attributes": {
186+
"relation": {
187+
"element": "string",
188+
"content": "origin"
189+
},
190+
"href": {
191+
"element": "string",
192+
"content": "http://docs.apiary.io/validations/swagger#swagger-validation"
193+
}
194+
}
195+
}
196+
]
197+
}
198+
},
199+
"attributes": {
200+
"code": {
201+
"element": "number",
202+
"content": 4
203+
}
204+
},
205+
"content": "Missing required property: schema"
206+
},
207+
{
208+
"element": "annotation",
209+
"meta": {
210+
"classes": {
211+
"element": "array",
212+
"content": [
213+
{
214+
"element": "string",
215+
"content": "error"
216+
}
217+
]
218+
},
219+
"links": {
220+
"element": "array",
221+
"content": [
222+
{
223+
"element": "link",
224+
"attributes": {
225+
"relation": {
226+
"element": "string",
227+
"content": "origin"
228+
},
229+
"href": {
230+
"element": "string",
231+
"content": "http://docs.apiary.io/validations/swagger#swagger-validation"
232+
}
233+
}
234+
}
235+
]
236+
}
237+
},
238+
"attributes": {
239+
"code": {
240+
"element": "number",
241+
"content": 4
242+
}
243+
},
244+
"content": "Missing required property: type"
245+
},
246+
{
247+
"element": "annotation",
248+
"meta": {
249+
"classes": {
250+
"element": "array",
251+
"content": [
252+
{
253+
"element": "string",
254+
"content": "error"
255+
}
256+
]
257+
},
258+
"links": {
259+
"element": "array",
260+
"content": [
261+
{
262+
"element": "link",
263+
"attributes": {
264+
"relation": {
265+
"element": "string",
266+
"content": "origin"
267+
},
268+
"href": {
269+
"element": "string",
270+
"content": "http://docs.apiary.io/validations/swagger#swagger-validation"
271+
}
272+
}
273+
}
274+
]
275+
}
276+
},
277+
"attributes": {
278+
"code": {
279+
"element": "number",
280+
"content": 4
281+
},
282+
"sourceMap": {
283+
"element": "array",
284+
"content": [
285+
{
286+
"element": "sourceMap",
287+
"content": [
288+
{
289+
"element": "array",
290+
"content": [
291+
{
292+
"element": "number",
293+
"attributes": {
294+
"line": {
295+
"element": "number",
296+
"content": 7
297+
},
298+
"column": {
299+
"element": "number",
300+
"content": 8
301+
}
302+
},
303+
"content": 97
304+
},
305+
{
306+
"element": "number",
307+
"attributes": {
308+
"line": {
309+
"element": "number",
310+
"content": 9
311+
},
312+
"column": {
313+
"element": "number",
314+
"content": 0
315+
}
316+
},
317+
"content": 28
318+
}
319+
]
320+
}
321+
]
322+
}
323+
]
324+
}
325+
},
326+
"content": "Missing required property: $ref"
327+
}
328+
]
329+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
swagger: '2.0'
2+
info:
3+
title: Schema Errors
4+
version: 1.0.0
5+
paths:
6+
/:
7+
parameters:
8+
- in: query
9+
name: foo

0 commit comments

Comments
 (0)