I’m looking for a way to query specific values from a json api response’s.
a bit xpath like query language.
I was thinking, transform the json to xml, run the xpath’s and return the results.
is there a suitable library out there?
I’m looking for a way to query specific values from a json api response’s.
a bit xpath like query language.
I was thinking, transform the json to xml, run the xpath’s and return the results.
is there a suitable library out there?
There is RFC 6901 which defines JSON Pointer specification. With that term I have found something like that - https://github.com/odogono/elixir-jsonpointer.
I am working to port Stefan Goessner JsonPath implementation to elixir, but it still in development stage.
I use jsn for json path queries:
% #{<<"user">> => #{<<"activated">> => true,
% <<"id">> => <<"123">>,
% <<"name">> => #{<<"first">> => <<"Jane">>,
% <<"last">> => <<"Doe">>}}}
% get the user id
UserId = jsn:get('user.id', User).
% <<"123">>
thanks, I will try pointer & json path