-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: comparison after schema reference change
Continue comparison of referenced schemas after a ref change so that we can still lint all modifications after renaming a model instead of only returning a breaking change for this rename.
- Loading branch information
Showing
4 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/Criteo.OpenApi.Comparator.UTest/Resource/reference_redirection_type_changed/diff.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[ | ||
{ | ||
"Severity": "Warning", | ||
"Message": "The \u0027$ref\u0027 property points to different models in the old and new versions.", | ||
"OldJsonRef": "#/paths/~1orders/get/responses/200/content/application~1json/schema/items", | ||
"NewJsonRef": "#/paths/~1orders/get/responses/200/content/application~1json/schema/items", | ||
"Id": 1017, | ||
"Code": "ReferenceRedirection", | ||
"Mode": "Update" | ||
}, | ||
{ | ||
"Severity": "Warning", | ||
"Message": "The new version has a different type \u0027string\u0027 than the previous one \u0027integer\u0027.", | ||
"OldJsonRef": "#/paths/~1orders/get/responses/200/content/application~1json/schema/items/properties/id/type", | ||
"NewJsonRef": "#/paths/~1orders/get/responses/200/content/application~1json/schema/items/properties/id/type", | ||
"Id": 1026, | ||
"Code": "TypeChanged", | ||
"Mode": "Update" | ||
}, | ||
{ | ||
"Severity": "Warning", | ||
"Message": "The new version is missing a definition that was found in the old version. Was \u0027Order\u0027 removed or renamed?", | ||
"OldJsonRef": "#/schemas/Order", | ||
"NewJsonRef": "#/schemas/Order", | ||
"Id": 1006, | ||
"Code": "RemovedDefinition", | ||
"Mode": "Removal" | ||
} | ||
] |
25 changes: 25 additions & 0 deletions
25
src/Criteo.OpenApi.Comparator.UTest/Resource/reference_redirection_type_changed/new.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: My API | ||
version: 0.2.0 | ||
paths: | ||
/orders: | ||
get: | ||
responses: | ||
"200": | ||
description: Successful Response | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Commande" | ||
components: | ||
schemas: | ||
Commande: | ||
type: object | ||
properties: | ||
id: | ||
type: string | ||
name: | ||
type: string |
25 changes: 25 additions & 0 deletions
25
src/Criteo.OpenApi.Comparator.UTest/Resource/reference_redirection_type_changed/old.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
openapi: 3.0.0 | ||
info: | ||
title: My API | ||
version: 0.1.0 | ||
paths: | ||
/orders: | ||
get: | ||
responses: | ||
"200": | ||
description: Successful Response | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
$ref: "#/components/schemas/Order" | ||
components: | ||
schemas: | ||
Order: | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
name: | ||
type: string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters