Closed vanillajonathan closed 1 week ago
Assuming that arbitrary type descriminiators are valid in OpenAPI, then that sounds reasonable. However we'd want to make it generic if possible (int
, bool
, etc.), rather than only supporting either an int
or a string
.
Careful, it looks like the discriminator property must be a string. See https://redocly.com/docs/resources/discriminator and https://docs.42crunch.com/latest/content/oasv3/oasconformance/semantics/v3-semantic-discriminator-string.htm.
Thanks for looking into that @bkoelman
If that's the case, then this isn't something we would add to Swashbuckle.
Is your feature request related to a specific problem? Or an existing feature?
I am using integers as type discriminator.
The
SelectDiscriminatorValueUsing
method can only return aString
.Describe the solution you'd like
An overload for the
SelectDiscriminatorValueUsing
method that accepts a custom selector with the signatureFunc<Type, int> customSelector
.Additional context
No response