openapi-backend icon indicating copy to clipboard operation
openapi-backend copied to clipboard

Allow checking for Set-Cookie _response_ headers

Open JasonWoof opened this issue 5 years ago • 0 comments

I do response validation, and I want to make sure that when my login endpoint is responding with a successful http response code that it's setting at least one cookie.

I put this in my spec:

responses: {
    "204": {
        description: "success",
        headers: {
            "Set-Cookie": {
                description: "Cookie",
                schema: {
                    type: "string",
                    minLength: 1,

But validation always fails, despite the chrome inspector telling me that there were two "Set-Cookie" headers.

Here's the error from openid-backend:

{
    "keyword": "required",
    "dataPath": ".headers",
    "schemaPath": "#/properties/headers/required",
    "params": {
        "missingProperty": "set-cookie"
    },
    "message": "should have required property 'set-cookie'"
}

JasonWoof avatar May 17 '20 00:05 JasonWoof