Open GoogleCodeExporter opened 8 years ago
Thanks for reporting. I think a workaround would be to escape it with single
quotes.
Original comment by johan.ha...@gmail.com
on 27 Jun 2015 at 5:01
I started to implement this but it turns out that it's quite tricky and I'm not
sure it's worth the effort. For example in JSON you could define properties
like this:
{ "some-list[0]" : "one" }
and of course
{ "some-list" : [ "one", "two" ] }
Currently the implementation don't have a reference to the actual property name
in the JSON structure while escaping "keys" in the path. This make is very
difficult to determine if path "some-list[0]" should be escaped as
"'some-list[0]'" or "'some-list'[0]".
One thing that I could do is of course to assume that it'll be escape as
"'some-list'[0]" (i.e. a list) and if you name your property "some-list[0]"
it'll fail and you'll have to manually escape it (i.e. I will need to break
backward compatibility). But I suppose that people naming their properties like
"some-list[0]" would be quite rare..
What do you think?
Original comment by johan.ha...@gmail.com
on 27 Jun 2015 at 5:54
Original issue reported on code.google.com by
winter.k...@gmail.com
on 8 Jun 2015 at 7:05