request-property-discriminator-mapping-changed

Request property discriminator mapping changed.

directionrequestareaschemakindstructureactionchange

Not breaking (level: info)

oasdiff records this in the changelog but does not fail CI by default. Requests that were valid under the old contract are still valid, so existing clients are not affected.

What this check detects

A `discriminator` tells tooling which subschema of a `oneOf` or `anyOf` a payload belongs to, by looking at one property. Its `mapping` connects each value of that property to a schema.

Changing a mapping entry repoints a value at a different schema. oasdiff reports it as informational because the discriminator is a resolution hint, not the validation itself: what a request must look like is still decided by the `oneOf` / `anyOf` branches. It is worth reviewing though, since generated clients use the mapping to choose a type, so a remap can change which model a payload deserializes into.

Example

Before
After
1requestBody:1requestBody:
2 content:2 content:
3 application/json:3 application/json:
4 schema:4 schema:
5 oneOf:5 oneOf:
6 - $ref: '#/components/schemas/Cat'6 - $ref: '#/components/schemas/Cat'
7 - $ref: '#/components/schemas/Dog'7 - $ref: '#/components/schemas/Dog'
8 discriminator:8 discriminator:
9 propertyName: petType9 propertyName: petType
10 mapping:10 mapping:
11 cat: '#/components/schemas/Cat'11 cat: '#/components/schemas/Dog'

A request with "petType": "cat" now resolves to Dog. The oneOf branches still decide what validates, but a generated client picks a different model.

Change its severity

oasdiff reports request-property-discriminator-mapping-changed as informational, so it does not fail CI. To treat it as a warning or an error under your own compatibility policy, or to turn it off, set its level in 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-property-discriminator-mapping-changed err

Then pass it to oasdiff:

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

Related schema rules

Browse all 509 checks →