Skip to content

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

Merged
joschi merged 1 commit into
OpenAPITools:masterfrom
orange-buffalo:#198
Feb 28, 2022
Merged

#198: Fixing false positive breaking change reported when removing an optional field from a response#327
joschi merged 1 commit into
OpenAPITools:masterfrom
orange-buffalo:#198

Conversation

@orange-buffalo

Copy link
Copy Markdown
Contributor

Fixes #198

@Test
public void testDiffDifferent() {
assertOpenApiBackwardIncompatible(OPENAPI_DOC1, OPENAPI_DOC2);
assertOpenApiBackwardCompatible(OPENAPI_DOC1, OPENAPI_DOC2, true);

Copy link
Copy Markdown
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.

schemas:
B:
type: object
required: ["message2"]

Copy link
Copy Markdown
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

@julienrf julienrf left a comment

Copy link
Copy Markdown
Contributor

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

@joschi joschi left a comment

Copy link
Copy Markdown
Contributor

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

3 participants