Skip to content
New issue

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

Recursive descent is not supported #67

Open
iaik-jheher opened this issue Apr 16, 2024 · 0 comments
Open

Recursive descent is not supported #67

iaik-jheher opened this issue Apr 16, 2024 · 0 comments

Comments

@iaik-jheher
Copy link

The recursive descent operator does not appear to be implemented.

For example, $..name should find $.name, but also $.children[0].name, $.children.children.children[0].name, ...

In test case form:

@Test
fun recursiveDescentTest() {
    val obj = buildJsonObject {
        put("name", "Name #1")
        put("addr", "Street 1")
        putJsonArray("children") {
            addJsonObject {
                put("name", "Name #2")
            }
        }
    }
    assertEquals(setOf("Name #1", "Name #2"),
        JsonPath.pathEvery("$..name").getAll(obj).map { it.toString() }.toSet())
}
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

No branches or pull requests

1 participant