Adds support for receiving and returning DateOnly/TimeOnly as ISO 8601 string to ASP.NET Core API
$ dotnet add package DateOnlyTimeOnly.AspNet.SwashbuckleAdds support for receiving and returning DateOnly/TimeOnly as ISO 8601 string to ASP.NET Core API
Get it from NuGet
Call AddDateOnlyTimeOnlyStringConverters on services:
builder.Services.AddDateOnlyTimeOnlyStringConverters();
After that:
DateOnly and TimeOnly action arguments will be received and returned as ISO 8601 string;TimeOnly as Dictionary key (the rest is available out of the box).No additional action is needed.
No additional action is needed.
Install DateOnlyTimeOnly.AspNet.Swashbuckle package, and add UseDateOnlyTimeOnlyStringConverters to your swagger configuration:
builder.Services.AddSwaggerGen(c => c.UseDateOnlyTimeOnlyStringConverters());