I have a piece of JS running in IE with the following line:
var data = JSON.parse("{ skill: 'SK_AUTO_DEV_TEST', kind: 'IS_REQUIRED' }");
Can anyone tell me what's wrong with this?
The Description field I was passing has characters that JSON considers invalid characters. In order to use those characters they have to be escaped. typically with a backslash. Anyway, it was simple replace operation, although I used multiple compose.
36151b9e-ad0d-49de-a14b-5461489c7065 is invalid JSON. Maybe you meant "36151b9e-ad0d-49de-a14b-5461489c7065", which is valid JSON. It appears that you are trying to parse a string that is not valid JSON.
This JSON in particular shows as valid. There's a chance that your particular client/library that handles the JSON that gets sent to ModSecurity is screwing up something and breaking the JSON.
Because that is not Valid JSON – you need quotes around the property names. To elaborate on epascarello's answer, please refer to json.org. Note in the first diagram that the name in the name/value pair is defined as "string". Then note in the diagram that defines "string" that it must begin and end with double-quote.
Because that is not Valid JSON – you need quotes around the property names.
JSON.parse('{ "skill": "SK_AUTO_DEV_TEST", "kind": "IS_REQUIRED" }');
To elaborate on epascarello's answer, please refer to json.org. Note in the first diagram that the name in the name/value pair is defined as "string". Then note in the diagram that defines "string" that it must begin and end with double-quote. Also note that this applies to both name and value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With