Skip to content

Verify a field is not present? #56

@hjohn

Description

@hjohn

I'm trying to check if a field is not present, but none of these work:

 JsonAssertion.assertThat("{}").field("targetId").isEmpty();
 JsonAssertion.assertThat("{}").field("targetId").isNull();

They just result in:

 com.jayway.jsonpath.PathNotFoundException: No results for path: $['targetId']

Is there a way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions