You make a fair point as well. :)
I think that the best way to move forward is either for you to update your
tests to not care about object order, or for me to add the "canonical" flag
I mentioned above. I would prefer that you updated your tests, because
that's less work on my part, but I'm OK with doing the work if need be. Or
we could split the difference and I could advise you on adding the flag
yourself. :D
Up to you.
KP
On Thu, Sep 12, 2019 at 1:52 PM Christoph Burgmer via RT <
bug-JSON-Path@rt.cpan.org> wrote:
Show quoted text> Queue: JSON-Path
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=130488 >
>
> Fair point, but let's also call out
>
> > JSON parsing libraries have been observed to differ as to whether or
> > not they make the ordering of object members visible to calling
> > software. Implementations whose behavior does not depend on member
> > ordering will be interoperable in the sense that they will not be
> > affected by these differences.
>
> It seems some people have seen the need to somewhat pass on the order.
>
> Anyhow, let me know what you think is reasonable for your library. Feel
> free to give the json-path-comparison project a run, it's meant to help,
> not enforce :)
>
> Am Do., 12. Sept. 2019 um 18:54 Uhr schrieb Kit Peters via RT <
> bug-JSON-Path@rt.cpan.org>:
>
> name/value
> > pairs".
> >
> > To your question above of what constitutes "good" JSONPath, I would say
> > that good JSONPath produces results that a reasonable person would expect
> > having read Goessner's definition and RFC 8159. Thus, to put the question
> > in the context of this issue, if a JSONPath implementation imposes an
> order
> > on the keys of an object, that implementation is out of compliance with
> the
> > spec, consensus or no.
> >
> >
> >
> > On Thu, Sep 12, 2019 at 11:00 AM Kit Peters <popefelix@gmail.com> wrote:
> >
> > > "Just for reference, I've tried looking for a source on the much quoted
> > > JSON
> > > standard"
> > >
> > > Ah, that's an easy one! :)
> > >
> > > RFC 7159 (
http://www.rfc-editor.org/rfc/rfc7159.txt) states "An object
> > is
> > > an *unordered* collection of zero or more name/value pairs" (emphasis
> > > mine)
> > >
> > > On Thu, Sep 12, 2019, 10:38 Christoph Burgmer via RT <
> > > bug-JSON-Path@rt.cpan.org> wrote:
> > >
> > >> Queue: JSON-Path
> > >> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=130488 >
> > >>
> > >> Just for reference, I've tried looking for a source on the much quoted
> > >> JSON
> > >> standard as it came up in other discussions as well, and so far only
> > found
> > >>
> > >> > The JSON syntax does not impose any restrictions on the strings used
> > as
> > >> names, does not require that name strings be unique, and does
> > >> not
> > >> assign any significance to the ordering of name/value pairs. These
> are
> > >> all semantic considerations that may be defined by JSON processors or
> in
> try
> > >> to
> > >> focus the general discussion on ordering for JSONPath, but wanted to
> > call
> > >> this out here once.
> > >>
> > >> Am Do., 12. Sept. 2019 um 17:24 Uhr schrieb Christoph Burgmer <
> > >> christoph.burgmer@gmail.com>:
> > >>
> > >> > I needed some time to think on this.
> > >> >
> > >> > What's currently making the outcome hard to compare is that a query
> > like
> > >> > `$[*]` on an object doesn't yield a stable representation. If there
> is
> > >> a,
> > >> > say, simple way of achieving that, it would help, yes.
> > >> > The ordering has to already be preserved when parsing the JSON
> > document
> > >> > though (see
> > >> >
> > >>
> >
>
https://github.com/cburgmer/json-path-comparison/blob/Perl_JSON-Path/implementations/Perl_JSON-Path/main.pl#L9
> > >> ),
> > >> > as this already introduces indeterminism in Perl I believe (as
> > >> decode_json
> > >> > returns a hash I believe). Python for example does allow that.
> > >> >
> > >> > Kit, my goal with the comparison project is to seek clarification on
> > >> what
> > >> > "good" JSONPath is (including I guess when a certain order can be
> > >> > guaranteed), but I'm trying to keep my on personal opinion out of
> it,
> > >> hence
> > >> > the whole approach of comparing via consensus.
> > >> >
> > >> >
> > >>
> > >>
> >
> > --
> > Kit Peters, W0KEH
> > GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56
> > ED1D
> > Hello to any and all NSA, DEA, or other government or non-government
> agents
> > reading this email. Tell me about your life; I'll tell you about mine.
> >
> >
>
>
--
Kit Peters, W0KEH
GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 ED1D
Hello to any and all NSA, DEA, or other government or non-government agents
reading this email. Tell me about your life; I'll tell you about mine.