I tried to use the function cJSON_Print and saw that the forward slashes (solidus) are not escaped.
Example:
{
"tests": [{
"id": "1",
"test": "/group1/subgroup1/"
}]
}
The string definition (http://www.json.org/string.gif) in my opinion shows, that the forward slashes (solidus) have to be escaped.
Could you check, whether this is an error in cJSON?
Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I tried to use the function cJSON_Print and saw that the forward slashes (solidus) are not escaped.
Example:
{
"tests": [{
"id": "1",
"test": "/group1/subgroup1/"
}]
}
The string definition (http://www.json.org/string.gif) in my opinion shows, that the forward slashes (solidus) have to be escaped.
Could you check, whether this is an error in cJSON?
Thanks
Yeah, it's fine. It will accept escaped solidus in input, and there's no ambiguity in non-escaped solidus in output.
Output only needs to escape as much as could be ambiguous. Input must be permissive.
If you have an application that requires it, it's trivial to add, but I won't push to main branch.