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
Ideally both oneOf and discriminator (which is really just a more strict variant of oneOf) get implemented using common interfaces. For oneOf the interface would not have any members, but for discriminator it should have the property that is used to discriminate and the type of that field would be an enum of all the possible values.
That would make it possible to use exhaustive switch statements with the type but also the property.
I think oneOf and discriminator need to be handled separately. Only with a discriminator we know that all schemas are objects and have at least one common field. With a plain oneOf we don't as any combination is possible.
Since #1173 discriminators are no longer supported.
There is no way to support them with records so we will need to generate these ofs the old way.
Another Idea would be to wrap these records in a class that handles the discriminator.
The text was updated successfully, but these errors were encountered: