(PB 2017 R3 build 1858 / Windows 10 )
From an httpclient object I receive JSON strings that I need to parse. They may be quite complicated with deeply nested structures.
My first problem is to parse NULL values.
My preliminary code looks like this:
ls_result = ij_parser.loadstring(as_json)
ll_root = ij_parser.getrootitem( )
this.ErrorDetails = ij_parser.getitemstring(ll_root,"ErrorDetails")
and so on for the various elements. I know the expected datatypes, of course.
However, there may be a null or more in the dataset, like this:
This code causes runtime exceptions, rather than returning null strings. Why? Buggy parser? I would have expected null strings to be returned.
To avoid it I have to wrap every getitem in aTRY-CATCH block , and do a setnull in the catch part. Yikes.
Is there a better way without going completely low-level?