forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consider numeric string json for EnumConverter. (dotnet#79432)
* Consider numeric string json for EnumConverter. * Fix comment: just use bit operation rather than HasFlag. * Add test. * Refine code. * Fix comment: refine comment. * Revert EnumConverter change. * Complete check if current value is numeric string value, and then bypass enum parsing by numeric value. * Add more tests. * Fix issue on non-netcoreapp target. * Use new CreateStringEnumOptionsForType() in tests. * Fix comment: move check logic into TryParseEnumCore; turn to use RegEx. * use regex generator. * Add fs test cases about Enum with numeric labels. * Update fs test case. * Fix comment: refine test cases in F#. * Fix comment: refine test cases in F#. * Fix comment: refine Regex usage. * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs * Move Regex to non-generic helper class * Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverter.cs * Remove duplicated logic * Remove raw pointer usage. --------- Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
- Loading branch information
1 parent
85d0169
commit 7d429e4
Showing
5 changed files
with
183 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters