Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently when asserting deeply nested JSON documents you have to chain path() methods to get to the leaf nodes. This can become very noisy:
path()
expectThat(jsonNode) { path("_links").path("self").path("href") .textValue().isEqualTo("http://xxx") }
A potential solution for this could be to integrate the JsonPath library (based on Jackson) to get something like this:
expectThat(jsonNode) { jsonPath("$_links.self.href") .textValue().isEqualTo("http://xxx") }
I might have time later this week to try out a PoC for this.
The text was updated successfully, but these errors were encountered:
Sounds good
Sorry, something went wrong.
at mapping for JsonNode subjects
at
JsonNode
ed7c6b0
Relevant to #152
6f9263b
2355364
Not JSON Path exactly but I've added at methods using Jackson's JSON Pointer support in 2355364. Your example above would be:
expectThat(jsonNode) .at("/_links/self/href") .textValue() .isEqualTo("http://xxx")
robfletcher
No branches or pull requests
Currently when asserting deeply nested JSON documents you have to chain
path()
methods to get to the leaf nodes. This can become very noisy:A potential solution for this could be to integrate the JsonPath library (based on Jackson) to get something like this:
I might have time later this week to try out a PoC for this.
The text was updated successfully, but these errors were encountered: