new-required-request-default-parameter-to-existing-path
Required request parameter added at path level.
Breaking change (level: error)
oasdiff reports this as a breaking change by default. It can break existing API clients, so CI fails on it unless you downgrade its severity.
What this check detects
A parameter can be declared at the path level (directly under the path, above the individual operations) or at the operation level. A path-level parameter applies to every operation on that path, so a single one added there affects GET, POST, and every other method at once.
This check flags the specific case of a new required parameter added at the path level of an existing path. Because it is inherited by all of the path’s operations, existing clients calling any method on that path now fail unless they send it.
Example
paths:
/users:
get:
responses:
'200':
description: OKpaths:
/users:
parameters:
- name: version
in: query
required: true
schema:
type: string
get:
responses:
'200':
description: OKThe required "version" parameter is declared once at the path level, so it now applies to GET /users (and any other operation added to this path). Existing clients do not send it, so their requests start failing validation.
Change its severity or ignore it
To change the severity oasdiff assigns to new-required-request-default-parameter-to-existing-path, list its id and a level in a severity-levels file, one rule per line. The level can be err, warn, or info, or none to disable the check entirely:
# severity.txt
new-required-request-default-parameter-to-existing-path warnThen pass it to oasdiff:
oasdiff changelog base.yaml revision.yaml --severity-levels severity.txtSetting the level to none disables the check, so it is no longer reported at all.