request-parameter-default-value-added

Request parameter default value set.

directionrequestareaparameterskindvaluesactionadd

Breaking change (level: error)

It restricts a request value to a fixed set or constant, so values that were valid before may now be rejected.

What this check detects

A `default` was added to a request parameter that had none. When a client omits the parameter, the server now substitutes the default instead of treating it as unset, which can change the response a client was relying on.

oasdiff reports adding a default as breaking for this reason. Changing an existing default is treated more leniently (informational), because behavior for omitted values was already defined.

Example

Before
After
1parameters:1parameters:
2 - name: limit2 - name: limit
3 in: query3 in: query
4 schema:4 schema:
5 type: integer5 type: integer
6 default: 20

A client that omitted "limit" previously got all results; now the server applies limit=20, changing the response.

How to handle this change

When oasdiff flags request-parameter-default-value-added, you have a few ways to respond:

  • Find a backward-compatible alternative. Redesign the change so clients that followed the old contract keep working, and agree on the approach with whoever introduced it.
  • Release it in a new API version. Keep the current contract and introduce the change in a new version, then deprecate the old one with a sunset date so clients have time to migrate.
  • Accept it as a deliberate breaking change. Sometimes a breaking change is unavoidable, such as an urgent or security fix. Approve it knowingly, document it in your release notes, and tell affected clients. This should be the exception, not a routine way of working.

If oasdiff's verdict does not match your API's compatibility policy, you can also change how it treats request-parameter-default-value-added with a severity-levels file:

Put one rule per line; the level can be err, warn, or info, or none to disable the check entirely:

# severity.txt
request-parameter-default-value-added warn

Then pass it to oasdiff:

oasdiff changelog base.yaml revision.yaml --severity-levels severity.txt

Related parameters rules

Browse all 509 checks →