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
The SelectDiscriminatorValueUsing method can only return a String.
builder.Services.AddSwaggerGen(c =>{ c.UseOneOfForPolymorphism(); c.SelectDiscriminatorNameUsing((baseType)=>"$type"); c.SelectDiscriminatorValueUsing((subType)=> subType.Name);// can only return String});
Describe the solution you'd like
An overload for the SelectDiscriminatorValueUsing method that accepts a custom selector with the signature Func<Type, int> customSelector.
Additional context
No response
The text was updated successfully, but these errors were encountered:
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.
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
The text was updated successfully, but these errors were encountered: