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

Treat new PUT request properties as compatible again #538

Merged
merged 2 commits into from
Jul 25, 2023

Commits on Jul 21, 2023

  1. Treat new PUT request properties as compatible.

    Effectively reverts change for OpenAPITools#136 which appears invalid in intent, implementation, and test.
    - Invalid in intent: OpenAPITools#136 claims that adding a readOnly property to the request body of a PUT request is a breaking change because clients will begin to omit it and the server will interpret the omission as a directive to delete the property. This is incorrect because the server should expect, [per the OAS spec](https://spec.openapis.org/oas/v3.0.3#fixed-fields-19), that readOnly properties "SHOULD NOT be sent as part of the request". So it would be a bug for the server to delete any data associated with the readOnly property. Regardless, the API is left unbroken if the server simply ignores readOnly properties.
    - Invalid in implementation: the code treats as incompatible any PUT request property, not just readOnly properties.
    - Invalid in test: no readOnly properties are tested.
    
    In theory one could argue that some servers might enforce the "SHOULD NOT" language of the spec by returning validation errors where they didn't before, and this would constitute an API breakage. But that should be discussed in a different issue.
    westse committed Jul 21, 2023
    Configuration menu
    Copy the full SHA
    be914cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0821b21 View commit details
    Browse the repository at this point in the history