Skip to content

Commit 4ce9103

Browse files
authored
Merge pull request #2390 from wjase/FIX_PANICS_AND_BOOST_COVERAGE
Fix panics and boost coverage
2 parents bdff91e + 8249e28 commit 4ce9103

18 files changed

+1377
-129
lines changed
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
BREAKING CHANGES:
2-
=================
3-
/a/:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
4-
/a/:get Request - Query.personality - Deleted possible enumeration(s) <saucy>
5-
/a/{id}:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
6-
/b/:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
7-
8-
compatibility test FAILED: 4 breaking changes detected
1+
BREAKING CHANGES:
2+
=================
3+
/a/:get - Request - Query.personality<string> - Deleted possible enumeration(s) - saucy
4+
/a/:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
5+
/a/{id}:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
6+
/b/:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
7+
compatibility test FAILED: 4 breaking changes detected

diff/fixtures/enum.diff.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
NON-BREAKING CHANGES:
2-
=====================
3-
/a/:get -> 200 Response - array[A1].personality : string - Deleted possible enumeration(s) <crazy>
4-
/a/:get Request - Query.personality - Added possible enumeration(s) <extrovert>
5-
/a/{id}:get -> 200 Response - array[A1].personality : string - Deleted possible enumeration(s) <crazy>
6-
/b/:get -> 200 Response - array[A1].personality : string - Deleted possible enumeration(s) <crazy>
2+
=====================
3+
/a/:get - Request - Query.personality<string> - Added possible enumeration(s) - extrovert
4+
/a/:get -> 200 - Response - Body<array[A1]>.personality<string> - Deleted possible enumeration(s) - crazy
5+
/a/{id}:get -> 200 - Response - Body<array[A1]>.personality<string> - Deleted possible enumeration(s) - crazy
6+
/b/:get -> 200 - Response - Body<array[A1]>.personality<string> - Deleted possible enumeration(s) - crazy
77

8-
BREAKING CHANGES:
9-
=================
10-
/a/:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
11-
/a/:get Request - Query.personality - Deleted possible enumeration(s) <saucy>
12-
/a/{id}:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
13-
/b/:get -> 200 Response - array[A1].personality : string - Added possible enumeration(s) <sane>
14-
15-
compatibility test FAILED: 4 breaking changes detected
8+
BREAKING CHANGES:
9+
=================
10+
/a/:get - Request - Query.personality<string> - Deleted possible enumeration(s) - saucy
11+
/a/:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
12+
/a/{id}:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
13+
/b/:get -> 200 - Response - Body<array[A1]>.personality<string> - Added possible enumeration(s) - sane
14+
compatibility test FAILED: 4 breaking changes detected

diff/fixtures/ignoreDiffs.json

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
11
[
22
{
33
"location": {
4-
"url": "/b/",
4+
"url": "/a/",
55
"method": "get",
6-
"response": 200,
76
"node": {
8-
"type": "A1",
9-
"is_array": true,
7+
"name": "Query",
108
"child": {
119
"name": "personality",
1210
"type": "string"
1311
}
1412
}
1513
},
1614
"code": "AddedEnumValue",
17-
"compatibility": "Breaking",
18-
"info": "sane"
15+
"compatibility": "NonBreaking",
16+
"info": "extrovert"
1917
},
2018
{
2119
"location": {
22-
"url": "/b/",
20+
"url": "/a/",
2321
"method": "get",
24-
"response": 200,
2522
"node": {
26-
"type": "A1",
27-
"is_array": true,
23+
"name": "Query",
2824
"child": {
2925
"name": "personality",
3026
"type": "string"
3127
}
3228
}
3329
},
3430
"code": "DeletedEnumValue",
35-
"compatibility": "NonBreaking",
36-
"info": "crazy"
31+
"compatibility": "Breaking",
32+
"info": "saucy"
3733
}
38-
]
3934

35+
]

diff/fixtures/ignoreFile.json

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,49 @@
11
[
22
{
33
"location": {
4-
"url": "/a/",
4+
"url": "/a/{id}",
55
"method": "get",
6+
"response": 200,
67
"node": {
7-
"name": "Query",
8+
"name": "Body",
9+
"type": "A1",
10+
"is_array": true,
811
"child": {
9-
"name": "personality"
12+
"name": "personality",
13+
"type": "string"
1014
}
1115
}
1216
},
1317
"code": "AddedEnumValue",
14-
"compatibility": "NonBreaking",
15-
"info": "extrovert"
18+
"compatibility": "Breaking",
19+
"info": "sane"
1620
},
1721
{
1822
"location": {
19-
"url": "/a/",
23+
"url": "/a/{id}",
2024
"method": "get",
25+
"response": 200,
2126
"node": {
22-
"name": "Query",
27+
"name": "Body",
28+
"type": "A1",
29+
"is_array": true,
2330
"child": {
24-
"name": "personality"
31+
"name": "personality",
32+
"type": "string"
2533
}
2634
}
2735
},
2836
"code": "DeletedEnumValue",
29-
"compatibility": "Breaking",
30-
"info": "saucy"
37+
"compatibility": "NonBreaking",
38+
"info": "crazy"
3139
},
3240
{
3341
"location": {
34-
"url": "/a/",
42+
"url": "/b/",
3543
"method": "get",
3644
"response": 200,
3745
"node": {
46+
"name": "Body",
3847
"type": "A1",
3948
"is_array": true,
4049
"child": {
@@ -49,10 +58,11 @@
4958
},
5059
{
5160
"location": {
52-
"url": "/a/",
61+
"url": "/b/",
5362
"method": "get",
5463
"response": 200,
5564
"node": {
65+
"name": "Body",
5666
"type": "A1",
5767
"is_array": true,
5868
"child": {
@@ -67,10 +77,11 @@
6777
},
6878
{
6979
"location": {
70-
"url": "/a/{id}",
80+
"url": "/a/",
7181
"method": "get",
7282
"response": 200,
7383
"node": {
84+
"name": "Body",
7485
"type": "A1",
7586
"is_array": true,
7687
"child": {
@@ -85,10 +96,11 @@
8596
},
8697
{
8798
"location": {
88-
"url": "/a/{id}",
99+
"url": "/a/",
89100
"method": "get",
90101
"response": 200,
91102
"node": {
103+
"name": "Body",
92104
"type": "A1",
93105
"is_array": true,
94106
"child": {

diff/fixtures/kitchensink.diff.txt

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
NON-BREAKING CHANGES:
2-
=====================
3-
Metadata - Spec.consumes - Added a consumes format <bob>
4-
Metadata - Spec.produces - Deleted produces format <bill>
5-
Metadata - Spec.schemes - Added schemes <https>
6-
/a/:get -> 200 Response- Added response
7-
/a/:get Request - Header.addedHeaderParam : string - Added optional param
8-
/a/:get Request - Header.deletedHeaderParam : string - Deleted optional param
9-
/a/:get Request - Header.headerParam.headerParam : string - Widened type <string.password -> string>
10-
/a/:get Request - Query.changeMaxInt - Widened type <Maximum 200.000000->300.000000>
11-
/a/:get Request - Query.removeMaxInt - Widened type <Exclusive Maximum Removed:true->false>
12-
/a/:get Request - Query.wideryString - Widened type <integer -> string>
2+
=====================
3+
/a/:get - Request - Header.addedHeaderParam - Added optional param
4+
/a/:get - Request - Header.deletedHeaderParam - Deleted optional param
5+
/a/:get - Request - Header.headerParam<string> - Widened type - string.password -> string
6+
/a/:get - Request - Query.removeMaxInt<integer> - Widened type - Exclusive Maximum Removed:true->false
7+
/a/:get - Request - Query.wideryString<string> - Widened type - integer -> string
8+
/a/:get -> 200 - Response - Body<array[A1]> - Added response
9+
/a/:post - Request - Body.description<string> - Changed required param to optional
10+
/a/{id}:get -> 200 - Response - Body<array[A1]>.newProp<string> - Added property
11+
/a/{id}:get -> 200 - Response - Body<array[A1]>.sameWideness<number> - Narrowed type - number -> number.float
12+
/a/{id}:post - Request - Body.description<string> - Changed required param to optional
13+
/b/:get -> 200 - Response - Body<array[A1]>.newProp<string> - Added property
14+
/b/:get -> 200 - Response - Body<array[A1]>.sameWideness<number> - Narrowed type - number -> number.float
15+
/b/:post - Request - Body.description<string> - Changed required param to optional
16+
/c/:get -> 200 - Response - Body<array[object]> - Added a schema constraint - MaxItems(1)
17+
Spec Definitions.ThisWasAdded - Added a schema definition
18+
Spec.consumes - Added a consumes format - bob
19+
Spec.produces - Added produces format - bob
20+
Spec.schemes - Added schemes - https
1321

14-
BREAKING CHANGES:
15-
=================
16-
Metadata - Spec Metadata - Changed base path </api -> /apibaby>
17-
Metadata - Spec Metadata - Changed host URL <petstore.swagger.wordnik.com -> petstore.swaggery.wordnik.com>
18-
Metadata - Spec.consumes - Deleted a consumes format <bill>
19-
Metadata - Spec.produces - Added produces format <bob>
20-
Metadata - Spec.schemes - Deleted schemes <http>
21-
/a/:get Request - Query.ObjToPrim - Changed type <obj -> integer>
22-
/a/:get Request - Query.changeMaxInt - Narrowed type <Exclusive Maximum Added:false->true>
23-
/a/:get Request - Query.changeMinInt - Narrowed type <Exclusive Minimum Added:false->true>
24-
/a/:get Request - Query.changeMinInt - Narrowed type <Minimum 200.000000->300.000000>
25-
/a/:get Request - Query.changeyPattern - Changed type <Pattern Changed:*->anewpattern>
26-
/a/:get Request - Query.primToObj : A2 - Changed type <integer -> obj>
27-
28-
compatibility test FAILED: 11 breaking changes detected
22+
BREAKING CHANGES:
23+
=================
24+
/a/:get - Request - Query.ObjToPrim<integer> - Changed type - object -> integer
25+
/a/:get - Request - Query.changeMaxInt<integer> - Narrowed type - Exclusive Maximum Added:false->true
26+
/a/:get - Request - Query.changeMinInt<integer> - Narrowed type - Exclusive Minimum Added:false->true
27+
/a/:get - Request - Query.changeyPattern<string> - Changed type - Pattern Changed:*->anewpattern
28+
/a/:get - Request - Query.primToObj - Changed type - integer -> object
29+
/a/:post -> 200 - Response - Body<A3>.name<string> - Changed required param to optional
30+
/a/{id}:get -> 200 - Response - Body<array[A1]>.busby<string> - Changed optional param to required
31+
/a/{id}:get -> 200 - Response - Body<array[A1]>.onceWasArray<array[object]> - Changed type - <array[object]> -> <string>
32+
/a/{id}:post -> 200 - Response - Body<A3>.name<string> - Changed required param to optional
33+
/b/:get -> 200 - Response - Body<array[A1]>.busby<string> - Changed optional param to required
34+
/b/:get -> 200 - Response - Body<array[A1]>.onceWasArray<array[object]> - Changed type - <array[object]> -> <string>
35+
/b/:post -> 200 - Response - Body<A3>.name<string> - Changed required param to optional
36+
/c/:get -> 200 - Response - Body<array[object]> - Deleted a schema constraint - MinItems(1)
37+
Spec Metadata - Changed base path - /api -> /apibaby
38+
Spec Metadata - Changed host URL - petstore.swagger.wordnik.com -> petstore.swaggery.wordnik.com
39+
Spec.consumes - Deleted a consumes format - bill
40+
Spec.produces - Deleted produces format - bill
41+
Spec.schemes - Deleted schemes - http
42+
compatibility test FAILED: 18 breaking changes detected

diff/fixtures/kitchensink.v1.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,25 @@
230230
}
231231
}
232232
}
233+
},
234+
"/c/": {
235+
"get": {
236+
"responses": {
237+
"200": {
238+
"description": "200 response",
239+
"schema": {
240+
"type": "array",
241+
"minItems": 1,
242+
"items": {
243+
"type": "object",
244+
"properties":{
245+
"id": {"type": "integer"}
246+
}
247+
}
248+
}
249+
}
250+
}
251+
}
233252
}
234253
},
235254
"definitions": {
@@ -249,6 +268,16 @@
249268
"empathic",
250269
"saucy"
251270
]
271+
},
272+
"busby": {
273+
"type": "string"
274+
},
275+
"onceWasArray": {
276+
"type": "array",
277+
"items":{"type": "object"}
278+
},
279+
"sameWideness": {
280+
"type": "number"
252281
}
253282
}
254283
},
@@ -269,6 +298,7 @@
269298
},
270299
"A3": {
271300
"type": "object",
301+
"required":["name"],
272302
"properties": {
273303
"id": {
274304
"type": "integer"

diff/fixtures/kitchensink.v2.json

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,31 @@
223223
}
224224
}
225225
}
226+
},
227+
"/c/": {
228+
"get": {
229+
"responses": {
230+
"200": {
231+
"description": "200 response",
232+
"schema": {
233+
"type": "array",
234+
"maxItems": 1,
235+
"items": {
236+
"type": "object",
237+
"properties":{
238+
"id": {"type": "integer"}
239+
}
240+
}
241+
}
242+
}
243+
}
244+
}
226245
}
227246
},
228247
"definitions": {
229248
"A1": {
230249
"type": "object",
250+
"required": ["busby"],
231251
"properties": {
232252
"id": {
233253
"type": "integer"
@@ -242,14 +262,40 @@
242262
"empathic",
243263
"saucy"
244264
]
265+
},
266+
"busby": {
267+
"type": "string"
268+
},
269+
"newProp": {
270+
"type": "string"
271+
},
272+
"onceWasArray": {
273+
"type": "string"
274+
},
275+
"sameWideness": {
276+
"type": "number",
277+
"format":"float"
245278
}
246279
}
247280
},
248281
"A2": {
249282
"type": "object",
250283
"required": [
251-
"name",
252-
"description"
284+
"name"
285+
],
286+
"properties": {
287+
"name": {
288+
"type": "string"
289+
},
290+
"description": {
291+
"type": "string"
292+
}
293+
}
294+
},
295+
"ThisWasAdded": {
296+
"type": "object",
297+
"required": [
298+
"name"
253299
],
254300
"properties": {
255301
"name": {

0 commit comments

Comments
 (0)