New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateOnly not rendering correctly in Swagger #2771
Comments
Also experiancing this with Controllers, when I tried upgrading to Swashbuckle.AspNetCore 6.5.0 to fix DateOnly serialisation fixed in #2319 but the Swagger.json broke with missing elements so I had to revert back to Swashbuckle.AspNetCore 6.4.0. Test
dotnet --version |
We should probably make a copy of WeatherForecast and add it to our integration tests, as it seems to come up often as the repro for issues 😄 |
Looks like this will be resolved by #2799. |
Add test for domaindrivendev#2771 for `DateOnly` values.
Add test for domaindrivendev#2771 for `DateOnly` values.
Add test for domaindrivendev#2771 for `DateOnly` values.
Add test for domaindrivendev#2771 for `DateOnly` values.
Add test for domaindrivendev#2771 for `DateOnly` values.
- Add support for .NET 8. - Bump version to `6.6.0`. - Add WeatherForecast .NET 8 Minimal API test application to resolve #2791. - Add test for #2771 for `DateOnly` values. - Use `JsonOptions` for Minimal APIs in .NET 8+ if not available from MVC. - Use `JsonSerializerOptions.Default` where available. - Use the Regex source generator for .NET 7+ to resolve #2794. - Refactor JsonSerializerOptions resolution - Make `ISerializerDataContractResolver` a singleton by default.
I think this may be a regression of #2319, but in investigating this stackoverflow question, I found that
DateOnly
fields are still not showing correctly in the Swagger UI in ASP.NET 8 latest.To reproduce:
dotnet new webapi
dotnet run
http://localhost:5261/swagger
Notice
DateOnly
andDayOfWeek
have been broken out into properties as if custom types, rather than being adate
.Apply the workaround:
Then it works:
This shouldn't be necessary though, right?
The text was updated successfully, but these errors were encountered: