Skip to content

Unable to specify JsonProvider when making MVC jsonPath() assertion #31423

Closed as not planned
@DevDengChao

Description

@DevDengChao
{
    "firstName": "John",
    "lastName": "doe",
    "age": 26,
    "address": {
        "streetAddress": "naist street",
        "city": "Nara",
        "postalCode": "630-0192"
    },
    "phoneNumbers": [
        {
            "type": "iPhone",
            "number": "0123-4567-8888"
        },
        {
            "type": "home",
            "number": "0123-4567-8910"
        }
    ]
}
mockMvc.perform(get("/user/John"))
    .andExpect(jsonPath("$.phoneNumbers[*].type").value( ??? ));

I was trying to make an assertion like something above, but there is no proper matcher helpers currently for the default JsonProvider (JsonSmartJsonProvider).
I opened netplex/json-smart-v2#162 to asking for JsonSmartMatchers as I cannot change what JsonProvider jsonPath() uses now.

This prevents me from choosing other JsonProvider who might have matcher helpers already.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions