forked from fabien0102/openapi-codegen
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Right now the type of a discriminator is a string or string union.
This is working but not actually representing the correct type. The type should be the same as the field that the discriminator is used on. Meaning if it is an enum, the discriminator should also be of said enum type instead of a string union.
Therefore we should use the discriminator type and extract the allowed keys of the type.
It seems to be, this type should cover this use case:
(Omit<PropName, 'descriminatorType'> & {
descriminatorType: Extract<PropName['descriminatorType'], 'decriminator'>;
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels