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

Addition of optional query parameters should not be considered as BREAKING CHANGE #87

Closed
dloibl opened this issue Jan 15, 2024 · 1 comment

Comments

@dloibl
Copy link

dloibl commented Jan 15, 2024

Hi,

adding optional query parameters, i.e. required: false is considered as breaking change, but it shouldn't.
Here is a minimal example to reproduce:

original.yaml

openapi: 3.1.0
paths:
  /api/foo:
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string

changed.yaml

paths:
  /api/foo:
    parameters:
      - foo:
          in: query
          name: foo
          schema:
            type: string
          required: false
    get:
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  name:
                    type: string

output:

openapi-changes version: 0.0.52 | compiled: Fri, 05 Jan 2024 13:54:26 UTC

SPEC extracted 2 commits from history
DONE completed

└─┬Paths
└─┬/api/foo
└──[+] parameters (5:7)❌

Date: 01/15/24 | Commit: New: ./changed.yaml, Original: ./original.yaml
Document Element | Total Changes | Breaking Changes
paths | 1 | 1

❌ 1 Breaking changes out of 1
INFO Additions: 1
INFO Breaking Additions: 1

ERROR breaking changes discovered
Error: breaking changes discovered

daveshanley added a commit to pb33f/libopenapi that referenced this issue Jan 19, 2024
optional parameters being added are not breaking, this was reported in openapi-changes  pb33f/openapi-changes#87

Signed-off-by: quobix <dave@quobix.com>
daveshanley added a commit to pb33f/libopenapi that referenced this issue Jan 20, 2024
optional parameters being added are not breaking, this was reported in openapi-changes  pb33f/openapi-changes#87

Signed-off-by: quobix <dave@quobix.com>
@daveshanley daveshanley reopened this Jan 20, 2024
@daveshanley
Copy link
Member

resolved in v0.0.53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants