Skip to content

Clarify absence of OapiResponseValidator and make middleware options more specific #1038

Description

@Antonboom

Hello!

OapiRequestValidatorWithOptions has ambiguous API. Not all fields from openapi3filter.Options are used:

oapimdlwr.OapiRequestValidatorWithOptions(v1Swagger, &oapimdlwr.Options{
    Options: openapi3filter.Options{
        ExcludeRequestBody:  false,
        ExcludeResponseBody: true, // Doesn't matter!
        AuthenticationFunc:  openapi3filter.NoopAuthenticationFunc,
    },
})

My bad, but I was sure that the oapi-codegen could validate the response.
And was surprised to find that there is no use of the openapi3filter.ValidateResponse.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions