zcl_mdp_json
zcl_mdp_json copied to clipboard
Raise exception in DESERIALIZE_OBJECT
Hi, when I try to deserialize a json string, I receive a "raise exception" on method DESERIALIZE_OBJECT at line 35 when it try to find regex '\A\s*"([^:]*)"\s*:
'
My json seems to be well formed (I tried to validate it with several online validators), I'm attaching it to the message.
Thanks
example.json.txt
Hi, the problem is in the last node "properties" where both keys name contains char :
.
A possible solution is to use this regex \A\s*"([a-zA-Z0-9:_]*)"\s*:
in order to accept also char :
in the key name. In this way deserializer works succesfully. Let me know.
Hi Teddynet, thank you for the issue report and the proposed solution. I will look into the issue and update the repo. Regards, Fatih
I face the same issue when a JSON key contains multiple ":" like "urn:eim:linkrel:session".
The issue with multiple ":" was solved by the updated regular expression from @Teddynet.
I faced another issue with a "-" in the JSON key.
With this regular expression everything is working now as expected:
\A\s*"([a-zA-Z0-9:_-]*)"\s*: