response-property-discriminator-mapping-changed

Response property discriminator mapping changed.

directionresponseareaschemakindstructureactionchange

Not breaking (level: info)

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

What this check detects

The response-side counterpart of a request discriminator mapping change: a value of the discriminator property now points at a different schema.

It is informational for the same reason, the mapping guides which subschema tooling resolves to, not what the server may return. Still worth a look, because a generated client deserializes the response into whatever model the mapping names.

Example

Before
After
1responses:1responses:
2 '200':2 '200':
3 description: OK3 description: OK
4 content:4 content:
5 application/json:5 application/json:
6 schema:6 schema:
7 oneOf:7 oneOf:
8 - $ref: '#/components/schemas/Cat'8 - $ref: '#/components/schemas/Cat'
9 - $ref: '#/components/schemas/Dog'9 - $ref: '#/components/schemas/Dog'
10 discriminator:10 discriminator:
11 propertyName: petType11 propertyName: petType
12 mapping:12 mapping:
13 cat: '#/components/schemas/Cat'13 cat: '#/components/schemas/Dog'

A response carrying "petType": "cat" now resolves to Dog for tooling that follows the mapping.

Change its severity

oasdiff reports response-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
response-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 →