Skip to content

Consider adding JsonPath support for JsonNode #152

@vbsteven

Description

@vbsteven

Currently when asserting deeply nested JSON documents you have to chain path() methods to get to the leaf nodes. This can become very noisy:

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.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions