request-body-discriminator-added
Request body discriminator added.
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 is a hint on a oneOf / anyOf schema that tells a consumer which of the listed subschemas a payload conforms to, by reading a named property (propertyName) rather than trying each subschema in turn. It is used mainly by code generators and validators to map a value to a concrete type.
Adding a discriminator changes how the request body is interpreted: the named property must now be present and must match one of the mapped subschemas. oasdiff reports it as informational, but review it, because a payload that validated against a branch by structure alone may now be routed by the discriminator value instead.
Example
A discriminator now selects which subschema the request body is validated against, based on the "petType" property.
Change its severity
oasdiff reports request-body-discriminator-added 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-body-discriminator-added errThen pass it to oasdiff:
oasdiff changelog base.yaml revision.yaml --severity-levels severity.txt