Skip to content

JsonPath filter expressions? #269

Closed Answered by Grueslayer
svenXY asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

no. The implemented parser is - as written - a simple one where you only have access to the fields and arrays by index.

JQ can be used to parse but is another syntax not compatible with JsonPath.

If you would like to use complex JsonPath expression you can use jsonpath-cli. Sadly it can not return the raw value, it will always return the value in JSON format (like "content") and adds linefeeds (because it could be a list).
But we can easily write a lua wrapper for it:

  {
    'mistweaverco/kulala.nvim',
    config = function()
      require('kulala').setup({
        contenttypes = {
          ["application/json"] = {
            pathresolver = function(body, path)
              local cmd

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@svenXY
Comment options

Answer selected by svenXY
Comment options

You must be logged in to vote
1 reply
@gorillamoe
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants