joshbuddy / jsonpath

Ruby implementation of http://goessner.net/articles/JsonPath/
MIT License
447 stars 72 forks source link

fix: Parser hangs on mid-string line feed character #155

Closed ipost closed 1 year ago

ipost commented 1 year ago

I noticed this when splitting long paths over multiple lines with a heredoc:

path = <<~PATH
  $.requestResponse.responseInfo.allClientInfo.abcdeSummary.
    stats[?(@.type == total)].value
PATH

I'm fine with having a local wrapper in my app to remove those characters, but the library should probably raise an error instead of hang.

joshbuddy commented 1 year ago

Thanks @ipost! This makes sense to me.