Skip to content

Document Hamcrest assertions if root is array #563

@dschulten

Description

@dschulten

Read the documentation, maybe we already have the feature

Is your feature request related to a problem? Please describe.
I couldn't find documentation about asserting the content of an array at root. In the end I found that the path to refer to an array at the json root is "", so this works:

@Test
    void assertsArraySize() {
        assertThat("[\"foo\",\"bar\"]", jsonPartMatches("", hasSize(2)));
    }

Describe the solution you'd like
Add array assertions at root to documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions