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

Shouldn't removing a request body type be a breaking change? #14

Closed
dalewking opened this issue Dec 13, 2018 · 5 comments
Closed

Shouldn't removing a request body type be a breaking change? #14

dalewking opened this issue Dec 13, 2018 · 5 comments
Labels
0.2.1 enhancement New feature or request

Comments

@dalewking
Copy link

Say oldAPI contains a path with:

  requestBody:
    content:
      application/xml:
        schema:
          $ref: '#/components/schemas/schema1'
      application/json:
        schema:
          $ref: '#/components/schemas/schema2'

And the new API removes one:

  requestBody:
    content:
     application/json:
        schema:
          $ref: '#/components/schemas/schema2'

That should be a breaking change since the path no longer accepts xml

@dalewking
Copy link
Author

Same thing for responses

@galovics galovics added enhancement New feature or request 0.3.0 labels Dec 13, 2018
@galovics
Copy link
Member

@dalewking fixed. Could you please give it a try? Thx!

@dalewking
Copy link
Author

dalewking commented Dec 17, 2018

Someone might complain about the fact that if old has "application/json" on a route and the new one says "*/*" that is a breaking change even though it is more permissive.

@dalewking
Copy link
Author

dalewking commented Dec 17, 2018

I am running into this with a DELETE route. We have a delete route that accepts a body (containing ID of the user requesting it and a reason for the deletion). So the oldApi has contentType application/json.

It is a bit controversial whether DELETE allows a request body. Some tools think it is like GET and does not allow a body. The spec is somewhat ambiguous. Certain tools do not allow it. Unfortunately, spring-fox which is what is generating our new API from the spring controller annotations for comparison is one of them. Even if you specify a consumes type it strips it off and it ends up going to */*.

Not sure if I am asking for a change, just thinking out loud.

@galovics
Copy link
Member

I mean it's a fair point, although I understand the concern with your specific case.
Anyway, I've implemented the */* fix.

@galovics galovics added 0.2.1 and removed 0.3.0 labels Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2.1 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants