Skip to content

Conversation

@mrkamel
Copy link
Contributor

@mrkamel mrkamel commented Dec 14, 2013

I'd like to propose a method to join paths, i.e. add/concatenate a path to an existing one:

JsonPath.new("$.store").join("book..author").on(document)
# => JsonPath.new("$.store.book.author")

The use case i encounter quite often is: in, e.g. unit tests, i use some kind of base path, and i want to extend it multiple times and for different json documents. As i want to stay DRY i can only concatenate strings. However, a #join method provided by JsonPath would be IMHO much cleaner.

Thanks for your feedback/review.

joshbuddy added a commit that referenced this pull request Jul 10, 2015
@joshbuddy joshbuddy merged commit ddad513 into joshbuddy:master Jul 10, 2015
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

Successfully merging this pull request may close these issues.

2 participants