If I receive JSON which is beyond my control, which has a property as follows.
{"allow":"true"}
and I want that to map to a bool
property in C#.
I saw that I can do similar for numbers using the attribute
[JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
but how can I do that for booleans?
Edit:
I am not sure why this is closed because of a duplicate question, since the other question focuses on converting from ints to bools