Open PeeDeeWhite opened 7 months ago
We were facing the same issue.
Seems to be a regression.
Seems to be a regression with .NET 8
.NET 8 reports a string:
.NET 7 an enum (correct)
A "fix" would be to use the [JsonSchemaType] attribute for now:
public void Post([FromBody, JsonSchemaType(typeof(TestEnum))] TestEnum asdf)
Thanks for providing a workaround! In my case it was failing one of the properties bound with [FromForm], I guess the reason is the same.
Do we expect a fix for any time in the foreseeable future ?
refresh topic, i have the same problem. Is there a better fix for that?
Hi
We have a number of controllers with actions that post an enum and that enum is taken from the body of the request. For example the following test action demonstrates the issue
Prior to v14 the swagger generated would have the request body content set to the enum type but with version 14 it is now treated as a string as shown below.
Is this an intended breaking change? The workaround is to removing the FromBody attribute but this has a significant impact for us.
v13.x
v14