False positive breaking-changes when moving a param from endpoint to path level
reuvenharrison opened this issue · comments
Reuven Harrison commented
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:
- Run
oasdiff changelog base.yaml revision.yaml
- With specs below
- 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
Reuven Harrison commented
Fixed by #479