Skip to content

Commit f926c8e

Browse files
zmay2030Ahmad Moudani
andauthored
record adding and removing schema from response in swagger diff #3074 (#3075)
Signed-off-by: Ahmad Moudani <ahmad.moudani@crowdstrike.com> Co-authored-by: Ahmad Moudani <ahmad.moudani@crowdstrike.com>
1 parent d0a73c6 commit f926c8e

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

diff/fixtures/response.diff.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ NON-BREAKING CHANGES:
55
/a/:put -> 200 - Response - Body<A3>.description<string> - Narrowed type - string -> integer.int32
66
/a/{id}:get -> 200 - Response - Body<A3>.colour<string> - Added property
77
/a/{id}:get -> 200 - Response - Body<A3>.description<string> - Narrowed type - string -> integer.int32
8+
/c/:post -> 204 - Response - Body<C6> - Added property
9+
Spec Definitions.C6 - Added a schema definition
810

911
BREAKING CHANGES:
1012
=================
1113
/a/:get -> 200 - Response - Body<array[A1]> - Deleted response
14+
/c/:post -> 200 - Response - Body<array[C1]> - Deleted property
1215
Spec Definitions.C5.a<array[string]> - Changed type - <array[string]> -> <object>
13-
compatibility test FAILED: 2 breaking changes detected
16+
compatibility test FAILED: 3 breaking changes detected

diff/fixtures/response.v1.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@
125125
}
126126
],
127127
"responses": {
128+
"200": {
129+
"description": "200 response",
130+
"schema": {
131+
"type": "array",
132+
"items": { "$ref": "#/definitions/C1" }
133+
}
134+
},
128135
"204": {
129136
"description": "204 response"
130137
}

diff/fixtures/response.v2.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,12 @@
125125
}
126126
],
127127
"responses": {
128+
"200": {
129+
"description": "200 response"
130+
},
128131
"204": {
129-
"description": "204 response"
132+
"description": "204 response",
133+
"schema": {"$ref": "#/definitions/C6"}
130134
}
131135
}
132136
}
@@ -260,6 +264,15 @@
260264
"type": "object"
261265
}
262266
}
267+
},
268+
"C6": {
269+
"required": [ "a"],
270+
"properties": {
271+
"a": {
272+
"type": "array",
273+
"items": {"type": "string"}
274+
}
275+
}
263276
}
264277
}
265278
}

0 commit comments

Comments
 (0)