Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#198: Fixing false positive breaking change reported when removing an optional field from a response #327

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

orange-buffalo
Copy link
Contributor

Fixes #198

@@ -16,6 +16,6 @@ public void testDiffSame() {

@Test
public void testDiffDifferent() {
assertOpenApiBackwardIncompatible(OPENAPI_DOC1, OPENAPI_DOC2);
assertOpenApiBackwardCompatible(OPENAPI_DOC1, OPENAPI_DOC2, true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test actually covers the use case in #198, just has incorrect assertion.

@@ -19,6 +19,7 @@ components:
schemas:
B:
type: object
required: ["message2"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test RecursiveSchemaTest expects backwards-incompatible change and by coincidence used removal of optional field from response as a change. Either the field should be required or the test should expect backwards-compatible change. I decided to go with the former.

@orange-buffalo orange-buffalo marked this pull request as ready for review January 25, 2022 05:44
Copy link
Contributor

@julienrf julienrf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @orange-buffalo!

@joschi joschi added the bug label Feb 28, 2022
@joschi joschi added this to the 2.1.0 milestone Feb 28, 2022
Copy link
Contributor

@joschi joschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orange-buffalo LGTM, thanks for your contribution!

@joschi joschi merged commit 46c7f23 into OpenAPITools:master Feb 28, 2022
@orange-buffalo orange-buffalo deleted the #198 branch March 4, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive breaking change reported when removing an optional field from a response
3 participants