Replies: 1 comment
-
Your understanding is close but not exactly accurate: by default this method only reads enough content from input to decode a single valid JSON value, and does not do anything more with any input there might still exist. But to get what you want here, you will need to enable You can enable that feature either on |
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
-
It's my understanding that I can use the readTree(string) in ObjectMapper to check if a String is valid JSON.
I tried this string: "{"msg":"hello there"}messedup" and it did not throw an exception, as I expected it to, even though it's not valid JSON.
Code:
var x = "{"msg":"hello there"}messedup";
objectMapper.readTree(x);
Beta Was this translation helpful? Give feedback.
All reactions