ietf-wg-jsonpath / draft-ietf-jsonpath-base

Development of a JSONPath internet draft
https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/
Other
59 stars 20 forks source link

Unfortunate rendering of index selector examples #193

Closed glyn closed 2 years ago

glyn commented 2 years ago

Some of these are split across lines in awkward places: linefeeds

We could either fix the rendering somehow to split at a more acceptable point or change the examples to avoid these awkward splits.

glyn commented 2 years ago

@cabo Do you know how to fix the rendering? E.g. I think it would be better not to split the lines in the middle of a quoted string, but splitting after ] would be ok.

cabo commented 2 years ago

Please check my little tweak to #192

goessner commented 2 years ago

What if we reduce each aspect to minimal necessary ... ?

{
      "o": {"j j":1, "k.k": 3},
      "o": {"j j":1, "k.k": 3},
      "a": ["a","b"],
      "'": {"@": 2}
}
Query Result Result Paths Comment
$.o['j j'] 1 $['o']['j j'] Named value in nested object
$.o["j j"] 1 $['o']['j j'] Named value in nested object
$.o['k.k'] 3 $['o']['k.k'] Named value in nested object
$.o["k.k"] 3 $['o']['k.k'] Named value in nested object
goessner commented 2 years ago

This seems to work ...

`$.o['j` `j']['k.k']`
cabo commented 2 years ago

This is essentially what https://github.com/ietf-wg-jsonpath/draft-ietf-jsonpath-base/pull/192/commits/bae20c2c657e01b9b17a186d73258e976cc10d44 does, except that it uses native nbsps.

goessner commented 2 years ago

ahh ... fine ...

glyn commented 2 years ago

There are two considerations I have in mind:

cabo commented 2 years ago

Left an editing note.

Copy/paste works for me in TXT (which has an ASCII space) and HTML (which has an NBSP, but that gets reduced in copy/paste).

glyn commented 2 years ago

Fixed as part of e82ce1f521e94ee2cd5b93d14726875e94a4a8e7.