Beginning in v2.2.2 I notice that my jsonPath checks now are more strict in the way that when a field in a response JSON does not exists or is an empty string and I have a “check” with a “saveAs” for that field I now get the following exception in runtime:
[INFO ] i.g.c.v.package$ - Boon failed to parse into a valid AST: JsonException: Unable to determine the current character, it is not a string, number, array, or object
The current character read is ‘o’ with an int value of 111
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
oauth_problem=token_rejected&oauth_problem_advice=the oauth_token is unacceptable to the Service Provider
^
io.advantageous.boon.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object
The current character read is ‘o’ with an int value of 111
Unable to determine the current character, it is not a string, number, array, or object
line number 1
index number 0
This mostly happens when I get a 401 ‘Unauthorized’ status code response from the API I am calling.
This didn’t happen before the upgrade to v2.2.2 and still occurs on v2.2.3.
I am thinking that if I get a “saveAsIfExists” method that always validates as successful even if the field to be saved does not exist, I could avoid these issues.
If there is no such option now, please help me understand how to implement it. I am browsing the source code and am not really sure what to do.
Thanks in advance.