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

Removing a Query parameter is considered a breaking change while removing a Request Body parameter isn't #412

Open
AdamBosseBS opened this issue Sep 15, 2022 · 0 comments · May be fixed by #474
Labels
Milestone

Comments

@AdamBosseBS
Copy link

While testing this tool, we've noticed that removing a query parameter would give a API changes broke backward compatibility result while removing a request body parameter would return a API changes are backward compatible. Shouldn't both be breaking changes?

If this is expected, we'd be curious to understand why that is.

Here are the spec files we used to test this:

image

old_queryparameter.yml :

openapi: "3.0.1"
info:
  title: "Public Api"
  description: ""
  version: "2022-08-23T16:17:54Z"
servers:
  - url: "https://someurl"
    variables:
      basePath:
        default: "/v1"
paths:
  /auth:
    post:
      parameters:
        - name: "Username"
          in: "query"
          required: true
          schema:
            type: "string"
        - name: "Password"
          in: "query"
          required: true
          schema:
            type: "string"

new_queryparameter.yml :

openapi: "3.0.1"
info:
  title: "Public Api"
  description: ""
  version: "2022-08-23T16:17:54Z"
servers:
  - url: "https://someurl"
    variables:
      basePath:
        default: "/v1"
paths:
  /auth:
    post:
      parameters:
        - name: "Username"
          in: "query"
          required: true
          schema:
            type: "string"

image

old_requestbody.yml:

openapi: "3.0.1"
info:
  title: "Public Api"
  description: ""
  version: "2022-08-23T16:17:54Z"
servers:
  - url: "https://someurl"
    variables:
      basePath:
        default: "/v1"
paths:
  /auth:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthRequest"
        required: true

components:
  schemas:
    AuthRequest:
      required:
        - "Username"
        - "Password"
      type: "object"
      properties:
        Username:
          type: "string"
        Password:
          type: "string"

new_requestbody.yml:

openapi: "3.0.1"
info:
  title: "Public Api"
  description: ""
  version: "2022-08-23T16:17:54Z"
servers:
  - url: "https://someurl"
    variables:
      basePath:
        default: "/v1"
paths:
  /auth:
    post:
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthRequest"
        required: true

components:
  schemas:
    AuthRequest:
      required:
        - "Username"
      type: "object"
      properties:
        Username:
          type: "string"

Thank you!

@AdamBosseBS AdamBosseBS changed the title Removing a Query parameter is considered a breaking changes while removing a Request Body parameter isn't Removing a Query parameter is considered a breaking change while removing a Request Body parameter isn't Sep 15, 2022
@joschi joschi added the bug label Sep 20, 2022
@joschi joschi added this to the 2.1.0 milestone Sep 20, 2022
joschi added a commit that referenced this issue Feb 28, 2023
@joschi joschi linked a pull request Feb 28, 2023 that will close this issue
@joschi joschi linked a pull request Feb 28, 2023 that will close this issue
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 a pull request may close this issue.

2 participants