Hi, i expected that System.Text.Json.Serialization.Converters.TimeOnlyConverter internally used "TimeOnly.Parse", since trying to parse "19:00" (without seconds) is valid input and one that is frequently used, the same as "7:00 PM" that is the output of TimeOnly.ToShortTimeString(). But neither of them works when trying to deserialize, i think TimeOnlyConverter needs to be a little more consistent with the formats supported by TimeOnly.
|
internal sealed class TimeOnlyConverter : JsonPrimitiveConverter<TimeOnly> |
Hi, i expected that System.Text.Json.Serialization.Converters.TimeOnlyConverter internally used "TimeOnly.Parse", since trying to parse "19:00" (without seconds) is valid input and one that is frequently used, the same as "7:00 PM" that is the output of TimeOnly.ToShortTimeString(). But neither of them works when trying to deserialize, i think TimeOnlyConverter needs to be a little more consistent with the formats supported by TimeOnly.
runtime/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/TimeOnlyConverter.cs
Line 9 in 11ff382