Skip to content

Message context not populated when validating response headers #25

Description

@slowmich-siemens

As title says, there is no way to extract any information about header which failed validation while validating response.

For instance, let's say your openapi spec says response header should look like this

responses:
  '200':
    description: blah blah
    headers:
      X-Env:
       description: Environment enum header
       schema:
         type: string
         enum: [dev, test, prod]

when response has header X-Env: 'wrong' validator produces this king of message does not have a value in the enumeration ["dev", "test", "prod"].
Context DOES NOT HAVE parameter value, it DOES NOT HAVE pointers.instance value. There is no way to which header this message is related to.

Generally it would be nice to have headers validation similar to request headers.
I don't understand why validating request headers produces messages with keys validation.request.parameter.schema.(...) and validating response headers produces messages with keys validation.response.header.schema.(...)
It should both be ...parameter.schema and parameter information in context should be populated with proper parameter names

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions