Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to add ValidationOptions to NewRouter() #613

Closed
yclybouw opened this issue Sep 23, 2022 · 0 comments · Fixed by #614
Closed

Allow to add ValidationOptions to NewRouter() #613

yclybouw opened this issue Sep 23, 2022 · 0 comments · Fixed by #614

Comments

@yclybouw
Copy link
Contributor

yclybouw commented Sep 23, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant