Skip to content

Allow to add ValidationOptions to NewRouter() #613

@yclybouw

Description

@yclybouw

In routers/legacy/route, we have the function:

func NewRouter(doc *openapi3.T) (routers.Router, error)

Which calls:

doc.Validate(context.Background())

As doc.Validate accepts validation options (signature: func (doc *T) Validate(ctx context.Context, opts ...ValidationOption) error) I would like to modify the NewRouter function (or add a new one named NewRouterWithValidationOptions), allowing to provide validation option:

func NewRouter(doc *openapi3.T, opts ...ValidationOption) (routers.Router, error)

If this is fine for you, I can create a pull request for it.

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