zvibo / common-schema

Automatically exported from code.google.com/p/common-schema
0 stars 0 forks source link

problem with quotes and json_to_xml #48

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This valid (but weird) JSON cannot be converted to XML:

+---+-------------------------------------------------+
| 1 | common_schema.json_to_xml('{ "body" : "\":" }') |
+---+-------------------------------------------------+
| 1 | NULL                                            |
+---+-------------------------------------------------+
1 row in set (0.03 sec)

(this is just the fragment breaking json_to_xml, if you want to see the full 
string, just ask)

Thanks for common_schema, it's great.

Original issue reported on code.google.com by martin.s...@gmail.com on 26 Aug 2013 at 11:04

GoogleCodeExporter commented 8 years ago
Thanks for this bug report; accepted.

Original comment by shlomi.n...@gmail.com on 27 Aug 2013 at 6:19

GoogleCodeExporter commented 8 years ago
Actually the string is not so valid. Shouldn't it be:

'{ "body" : "\\":" }'

?

Original comment by shlomi.n...@gmail.com on 7 Sep 2013 at 4:53

GoogleCodeExporter commented 8 years ago
Well, it seems to be valid (using json_pp and jsonlint)

runa:~/ $ jsonlint -v -s -f  && echo valid
{ "body" : "\":" }
{ "body" : "\":" }
valid

and

runa:~/ $ json_pp                                               
{ "body" : "\":" }
{
   "body" : "\":"
}

Original comment by martin.s...@gmail.com on 12 Sep 2013 at 2:00

GoogleCodeExporter commented 8 years ago
You are right; I got confused with double escaping SQL+JSON

Original comment by sno...@outbrain.com on 14 Sep 2013 at 9:08

GoogleCodeExporter commented 8 years ago
I would fix this myself but I'm clueless :) Please tell me if you need anything 
else.
tnx

Original comment by martin.s...@gmail.com on 9 Oct 2013 at 2:36

GoogleCodeExporter commented 8 years ago
No, I apologize; I haven't had much time to work this through; will try to 
attend shortly. Thank you for keeping an eye, and sorry for the delay.

Original comment by shlomi.n...@gmail.com on 10 Oct 2013 at 5:42