request-property-pattern-added

Request property pattern set.

directionrequestareaschemakindconstraintsactionadd

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 pattern constrains a string property to a regular expression. When a request property has no pattern, any string is accepted; adding one narrows what the server will accept.

This is a breaking change because values that were valid before, but that do not match the new expression, are now rejected. Existing clients that happened to send such values start failing validation with no change on their side.

Example

Before
schema:
  type: object
  properties:
    username:
      type: string
After
schema:
  type: object
  properties:
    username:
      type: string
      pattern: '^[a-z0-9]+$'

A pattern now constrains the "username" request property. Values that were valid before, such as "John_Doe", are now rejected.

Change its severity or ignore it

To change the severity oasdiff assigns to request-property-pattern-added, 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
request-property-pattern-added warn

Then pass it to oasdiff:

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

Setting the level to none disables the check, so it is no longer reported at all.

Related schema rules

Browse all 500 checks →