akshaymankar / jsonpath-hs

Haskell implementation of JSONPath
BSD 3-Clause "New" or "Revised" License
6 stars 5 forks source link

Is it possible to get the key? #46

Open ivanperez-keera opened 7 months ago

ivanperez-keera commented 7 months ago

Is there an expression I can use to obtain the key? For example, if I have:

{ "key" : "value" }

I want to obtain only "key".

akshaymankar commented 7 months ago

I think its not directly possible, once you have the Object you can get all its keys. Do you have a more complex example for this? Also checkout the RFC for JSONPath standardization: https://ietf-wg-jsonpath.github.io/draft-ietf-jsonpath-base/draft-ietf-jsonpath-base.html. Maybe it gives you some pointers.