Deserialize all dictionaries as case-insensetive?
See original GitHub issueSource/destination types
Dictionary<string, string>
Source/destination JSON
{
"dictionary" : {
"key1": "value1",
"key2": "value2"
}
Expected behavior
I’m able to configure Web API or Core to deserialize dictionary as case-insensetice
Actual behavior
Dictionary is always case sensitive. What makes contract resolver settings critical and potentially breaking:
- dictionary key comes in upper case
- camel case contract resolver makes it lower case
- code throws exception saying key in upper case was not found
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Deserialize into a case-insensitive dictionary using System. ...
For example, it could deserialize "SoMeNaMe" into a property on an object called SomeName without any additional property naming convention.
Read more >How to enable case-insensitive property name matching ...
By default, deserialization looks for case-sensitive property name matches between JSON and the target object properties.
Read more >C# - Case sensitivity in JSON deserialization
Json does case sensitive JSON deserialization. Case sensitivity comes into play when a JSON string is being deserialized into an object. If you' ......
Read more >How do you fix the wrong-case-sensitivity dictionary setting ...
We might want to use it like a plain old data class. So, we can deserialize JSON or SQL rows or whatever, to...
Read more >JSON: Dictionary with case insensitive keys
So to prevent problems with case sensitive keys I found this neat trick to ... DeserializeObject<Dictionary<string, object>>(_jsonSample); ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks @bartelink, I forgot about such an option 😃 Glad to see you here!
@seclerp It’s back! (also did you try https://archive.org/ ?)