Closed saneks222 closed 1 week ago
In fact I did considered it, and wrote exactly that line.
But then I had to switch back to this EnumConverter code due to different behaviour in case of invalid/unrecognized value (ours returns 0, theirs throw an exception)
Note that our EnumConverter code is largely inspired by JsonStringEnumConverter implementation, in order to be short and efficient, and has been tested to be compatible with Native AOT/Trimming.
I think the use of this: https://github.com/TelegramBots/Telegram.Bot/blob/master/src/Telegram.Bot/Serialization/EnumConverter.cs seems redundant to me.
Wouldn't this be a better solution ?
Public class JsonStringEnumSnakeCaseLowerConverter(): JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseLower);
usage
[JsonConverter(typeof(JsonStringEnumSnakeCaseLowerConverter))]