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
I found that if used on the query string, then both the model binder and swagger show a custom struct as if it were a complex type: ?date.year=0&date.month=0&date.day=0.
A corresponding IModelBinder can solve this for the api, but does not work for Swagger.
I would have thought that the options.MapType would be enough for Swashbuckle to correctly define the scheme in Swagger. Unfortunately for query string parameters it works a bit differently.
Exposing a custom type as a JSON string in an ASP.NET Core API - Thomas Levesque's .NET Blog
https://thomaslevesque.com/2020/06/27/exposing-custom-type-as-json-string-in-asp-net-core-api/
The text was updated successfully, but these errors were encountered: