You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this schema, having type 'A' requires both schema A and B to be valid. However, they are mutually exclusive. A requires fields type and a and no additional properties. B requires fields type and b and no additional properties. So the schema cannot be satisfied.
The simplest solution for this is requiring that each discriminator key is unique. This issue is related to #1492 .
The text was updated successfully, but these errors were encountered:
mvanniekerkSQ
added a commit
to mvanniekerkSQ/ts-json-schema-generator
that referenced
this issue
Dec 9, 2022
Using a discriminator annotation for union types with a non-unique discriminator generates a schema that is logically inconsistent.
For example:
Gives the following output:
In this schema, having type 'A' requires both schema
A
andB
to be valid. However, they are mutually exclusive.A
requires fieldstype
anda
and no additional properties.B
requires fieldstype
andb
and no additional properties. So the schema cannot be satisfied.The simplest solution for this is requiring that each discriminator key is unique. This issue is related to #1492 .
The text was updated successfully, but these errors were encountered: