This week I learned that serializing and deserialzing the new structs included with .NET 6, DateOnly and TimeOnly, is not supported by System.Text.Json.JsonSerializer. You´ll need to write custom converters and include them in the settings. This an example implementation of these converters:
You´ll then need to include them in the JsonSerializerOptions
Or you could mark the properties in your type with the JsonConverterAttribute:
Thanks for reading.