Skip Menu |

This queue is for tickets about the JSON-Path CPAN distribution.

Report information
The Basics
Id: 92237
Status: resolved
Priority: 0/
Queue: JSON-Path

People
Owner: Nobody in particular
Requestors: Max.Laager [...] nespresso.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.301



Subject: escaping dot in json::path
Date: Fri, 17 Jan 2014 17:33:48 +0000
To: "bug-JSON-Path [...] rt.cpan.org" <bug-JSON-Path [...] rt.cpan.org>
From: "Laager,Max,NNSA LAUSANNE,IT Database & Performance" <Max.Laager [...] nespresso.com>
Hello I tryied to esacpe the jsonpath ( I Have dots '.' In the name of the fields and can't parse json) Example my $jpath = JSON::Path->new('$..[ \'foo-bar\']'); # work fine but if I replace foo-bar with foo.bar in the json the json:path does not work any more my $jpath JSON::Path->new('$..[ \'foo.bar\']'); # does not work how do I escape the dots or can I fix this ? Max
The path parsing is pretty naïve, I'm afraid. I should rewrite it at some point. I've written way better parsers before.
I'd welcome a test case that breaks my path parsing. On Tue Feb 07 13:30:11 2017, TOBYINK wrote: Show quoted text
> The path parsing is pretty naïve, I'm afraid. > > I should rewrite it at some point. I've written way better parsers before.
I just re-read this ticket, and it's clear you weren't replying to my PR. oops. Sorry about that. On Tue Feb 07 13:34:13 2017, popefelix wrote: Show quoted text
> I'd welcome a test case that breaks my path parsing. > > On Tue Feb 07 13:30:11 2017, TOBYINK wrote:
> > The path parsing is pretty naïve, I'm afraid. > > > > I should rewrite it at some point. I've written way better parsers before.
>
This will be fixed in the next release; escape dots with a backslash ("\", ASCII 92) character. On Fri Jan 17 12:36:08 2014, Max.Laager@nespresso.com wrote: Show quoted text
> Hello > I tryied to esacpe the jsonpath ( I Have dots '.' In the name of the > fields and can't parse json) > Example > my $jpath = JSON::Path->new('$..[ \'foo-bar\']'); # work fine > but if I replace foo-bar with foo.bar in the json the json:path does > not work any more > my $jpath JSON::Path->new('$..[ \'foo.bar\']'); # does not work > > how do I escape the dots or can I fix this ? > > Max
Fixed in 0.301 On Fri Jul 07 17:11:05 2017, popefelix wrote: Show quoted text
> This will be fixed in the next release; escape dots with a backslash > ("\", ASCII 92) character. > > On Fri Jan 17 12:36:08 2014, Max.Laager@nespresso.com wrote:
> > Hello > > I tryied to esacpe the jsonpath ( I Have dots '.' In the name of the > > fields and can't parse json) > > Example > > my $jpath = JSON::Path->new('$..[ \'foo-bar\']'); # work fine > > but if I replace foo-bar with foo.bar in the json the json:path does > > not work any more > > my $jpath JSON::Path->new('$..[ \'foo.bar\']'); # does not work > > > > how do I escape the dots or can I fix this ? > > > > Max
On Tue Jul 11 14:42:45 2017, popefelix wrote: Show quoted text
> Fixed in 0.301 > On Fri Jul 07 17:11:05 2017, popefelix wrote:
> > This will be fixed in the next release; escape dots with a backslash > > ("\", ASCII 92) character. > > > > On Fri Jan 17 12:36:08 2014, Max.Laager@nespresso.com wrote:
> > > Hello > > > I tryied to esacpe the jsonpath ( I Have dots '.' In the name of the > > > fields and can't parse json) > > > Example > > > my $jpath = JSON::Path->new('$..[ \'foo-bar\']'); # work fine > > > but if I replace foo-bar with foo.bar in the json the json:path does > > > not work any more > > > my $jpath JSON::Path->new('$..[ \'foo.bar\']'); # does not work > > > > > > how do I escape the dots or can I fix this ? > > > > > > Max
> >