Skip to content

A union has no usable discriminator

output.union.discriminator-not-inferred

Category
Generated output
Default severity
Warning
Applies to
API specification
Default outcome
Completed with warnings
Recommended action
Fix the source
Grouped by
Defect code

Why it matters

No single required const-tagged property discriminates every member, so the union was emitted as a plain union and is not forward-compatible.

How to fix it

  1. Align every member on one required const property with distinct values (or set unions.discriminator_fallback: off).

Try-It is disabled for this portal. Copy the request from the console above to run it yourself.

Try-It is disabled for this portal. Copy the request from the console above to run it yourself.