dominictarr/JSON.sh

Forward slash escaping

Opened this issue · 2 comments

Hi all,

Jettison escapes forward slashes by default. JSON does not mandate forward slashes to be escaped. But escaping forward slahes is perfectly valid.
Using json.sh, when I try to parse JSON payloads that contain escaped forward slahes (/) I encounter issues.
Does json.sh handle escaped forward slashes?
Payload example

{
"ressources": {
"statut": "http://localhost:8080/mapb-abl-dua/batch/179/statut" }
}

Any help would be much appreciated.

I get this output:

> echo '{"ressources": {"statut": "http:\/\/localhost:8080\/mapb-abl-dua\/batch\/179\/statut" }}' | ./JSON.sh 
["ressources","statut"] "http:\/\/localhost:8080\/mapb-abl-dua\/batch\/179\/statut"
["ressources"]  {"statut":"http:\/\/localhost:8080\/mapb-abl-dua\/batch\/179\/statut"}
[]      {"ressources":{"statut":"http:\/\/localhost:8080\/mapb-abl-dua\/batch\/179\/statut"}}

which looks correct to me. what output did you get and what where you expecting?

zaa commented

Changes from #30 should help with the issue.