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

False positive breaking-changes when moving a param from endpoint to path level #378

Closed
reuvenharrison opened this issue Sep 16, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@reuvenharrison
Copy link
Collaborator

reuvenharrison commented Sep 16, 2023

Describe the bug
Comparing two specs with a parameter moved from endpoint level to path level produces wrong errors.
See also #376 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. Run oasdiff changelog base.yaml revision.yaml
  2. With specs below
  3. Receive:
2 changes: 1 error, 1 warning, 0 info
error	[new-required-request-default-parameter-to-existing-path] at data/request_params/required-request-params.yaml
	in API GET /api/test5
		added the new required 'query' request parameter 'emptyPath2' to all path's operations

warning	[request-parameter-removed] at data/request_params/required-request-params.yaml
	in API GET /api/test5
		deleted the 'query' request parameter 'emptyPath2'

Expected behavior
No errors

Base spec:

openapi: 3.0.1
info:
  title: Test API
  version: v1
paths:
  /api/test:
    get:
      operationId: getTest
      parameters:
        - in: query
          name: emptyPath2
          required: true
          schema:
            type: string

Revised spec:

openapi: 3.0.1
info:
  title: Test API
  version: v1
paths:
  /api/test:
    parameters:
      - in: query
        name: emptyPath2
        required: true
        schema:
          type: string
    get:
      operationId: getTest
@reuvenharrison reuvenharrison added the bug Something isn't working label Sep 16, 2023
@reuvenharrison
Copy link
Collaborator Author

Fixed by #479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant