System.Text.Json.JsonException extracting invalid character #96698
Unanswered
whoaskedfrfr
asked this question in
Q&A
Replies: 1 comment
-
If it is showing invalid character issues. It means there is some mistake in json. So I suggest checking whether Json is valid or not. If it is valid only then you need to do conversation otherwise you need to throw error or take care of input. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey,
There's this situation where I call into a service and deserialize the response with
ReadFromJsonAsync
. The problem is that there's a small subset of requests that throwSystem.Text.Json.JsonException
due to invalid character.Logging the JSON is not an option as it might contain PII. What is the recommended way of dealing with this scenario? Is there anything akin to - "expected a { but got ,"?
Beta Was this translation helpful? Give feedback.
All reactions