Conversation
|
Is there a valid case where unquoted keys are allowed? Allowing single quotes is already outside the JSON standard (http://www.json.org/ calls for double-quotes only) and I'd rather not diverge too much from the standard if possible. |
|
I have a webservice ( Amazon ) that is supplying unquoted keys. I would have thought that a parser should be fairly tolerant of its input, but also avoiding ambiguities. The unquoted key parser should really verify that the key is valid javascript identifier, but in my simple mod it is just looking for a space or ':' terminator. I have wrapped the mod in a check for a flag to enable the functionality of parsing 'simple' Javascript Object Literals. I believe that it is useful in processing data supplied from third parties that you cant change. |
|
Hi @odewdney thanks for the PR! I like the idea of hiding it behind an option flag, I'll look into it more and merge soon. |
|
@odewdney thanks again for the PR. I apologize it took me so long to get it merged. I've added a new |
|
FYI: I've updated a simple fix on #121 to also handle not quoted values. It depends on the same |
Key names are sometimes not quoted - added support to the json_ParseKey