Question utf8Json case Insensitive Deserialize string to class Model

Dev Think

Member
Joined
Jun 23, 2021
Messages
15
Programming Experience
1-3
I am trying to search on google for Cryptisk.utf8Json case insensitive work, but still I don't have got any result, so can you any suggest me if it is possible?
this is my Json request and that my model class, I want to Deserialize from request to there class model.
Json Request:
{
    "id":"1234567891011",
    "mobileNumber":"+9211111111",
    "address":"C-78 Ground."
}
class Model:
public class Root
{
    public string ID { get; set; }
    public string MobileNumber { get; set; }
    public string Address { get; set; }
}
JsonSerializer.Deserialize<Root>(JsonResponeResult)
FYI, JsonResponeResult is the string of json request which is show on above json
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,469
Location
Chesapeake, VA
Programming Experience
10+

Dev Think

Member
Joined
Jun 23, 2021
Messages
15
Programming Experience
1-3
Must not have been searching too hard. When I went to Google as searched for "JsonSerializer case insensitive", this was the first item on the search page:
Sorry, you are right but its a different tool/package, I had focus on Cryptisk.Utf8Json. please ignore System.Text.Json, and NewtonSoft.Json and other tools.
Thank You for response @Skydiver .

 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,469
Location
Chesapeake, VA
Programming Experience
10+
For that you should open an issue on his Github page, or try to dig through the source code to see if there is such an option. My quick scan only found ways to deal with camel casing.

The beauty of open source is that if you don't see what you like, you can fork and put in the features that you want.

A question to ask yourself though is: Do you really need the current features that Utf8Json provides? Has your performance testing shown that it is your JSON parsing which is the resource bottleneck? Or did you pick Utf8Json as part of some premature optimization?
 

Dev Think

Member
Joined
Jun 23, 2021
Messages
15
Programming Experience
1-3
For that you should open an issue on his Github page, or try to dig through the source code to see if there is such an option. My quick scan only found ways to deal with camel casing.

The beauty of open source is that if you don't see what you like, you can fork and put in the features that you want.

A question to ask yourself though is: Do you really need the current features that Utf8Json provides? Has your performance testing shown that it is your JSON parsing which is the resource bottleneck? Or did you pick Utf8Json as part of some premature optimization?
Thank you @Sydiver for response, I was found some solution but it did not proper work on my scenario, because my client service doesn't follow camel, upper , and lower case Meaning, it makes random property, so I will try your suggestion
 
Top Bottom