Skip to content

How to validate complex object responses #58

Open
@humbienri

Description

@humbienri

Hello,

Perhaps I am just not getting it, even after having read the example-spec.yaml example. How can I validate a more complicated response body/payload. For example, something like:

{
    "status": "ok",
    "info": {
        "stats": {
            "status": "up",
            "serviceName": "service.name",
            "version": "1.0.11"
        },
        "aConnector": {
            "status": "up"
        }
    },
    "details": {
        "stats": {
            "status": "up",
            "serviceName": "service.atyours",
            "version": "1.0.1"
        },
        "theConnector": {
            "status": "up"
        }
    }
}

I guess I am referring to nesting of json objects so as to confirm that the response body conforms to something more specific. Notice how some of those status keys are duplicated so it's not just a matter of validating that the "status up" exists somewhere in the response, but specifically.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions