Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JSONPath / JSON Pointer / jq #63

Open
mbtools opened this issue Jul 22, 2021 · 8 comments
Open

Support for JSONPath / JSON Pointer / jq #63

mbtools opened this issue Jul 22, 2021 · 8 comments

Comments

@mbtools
Copy link
Contributor

mbtools commented Jul 22, 2021

JSONPath could be a nice addition (https://restfulapi.net/json-jsonpath/):

image

Def:

  methods jsonpath
    importing
      iv_path type string
    returning
      value(ro_json) type if_asjon.

Example:

  lo_json->jsonpath( '$..attributes' ).

Anyone up for a JS or PHP to ABAP port?
https://code.google.com/archive/p/jsonpath/downloads

@sbcgua
Copy link
Owner

sbcgua commented Jul 23, 2021

Nice idea. Worth checking. Just some of commands will not be support e.g. reference from non root.

The .. is also a bit unclear - what if multiple nodes contain the attrs ? Is it the first one to select ?

@mbtools
Copy link
Contributor Author

mbtools commented Jul 23, 2021

.. returns all matching attributes. '$..attributes[0]` would give you the first.

@sbcgua
Copy link
Owner

sbcgua commented Jul 25, 2021

@mbtools
Copy link
Contributor Author

mbtools commented Jul 26, 2021

Jq would be an option, too. Looks like a package of C with dependencies, though.

@sbcgua
Copy link
Owner

sbcgua commented Jul 27, 2021

That was just for reference. Collecting some more data about the subject. jq is definitely widespread and popular. Maybe implement it's syntax instead. Just maybe.

@sbcgua
Copy link
Owner

sbcgua commented Aug 14, 2021

Also Json pointer

@sbcgua sbcgua mentioned this issue Sep 8, 2021
@larshp
Copy link
Collaborator

larshp commented Nov 15, 2021

also stumbled upon https://jmespath.org

@sbcgua
Copy link
Owner

sbcgua commented Apr 15, 2022

also JSON Pointer, which seems to be a part of JSON schema: https://datatracker.ietf.org/doc/html/draft-handrews-relative-json-pointer-01

@sbcgua sbcgua changed the title Support for JSONPath Support for JSONPath / JSON Pointer / jq May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants