-
Notifications
You must be signed in to change notification settings - Fork 0
feat: [ENG-2175] Re-enable OAPI validator #9
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
Conversation
| // In some instances, we want to continue processing the request | ||
| // even if validation fails. This is useful for logging or | ||
| // debugging purposes, or when the caller wants to handle the | ||
| // error in a different way. | ||
| if options == nil || !options.ContinueOnError { | ||
| return | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New explanation comment
jonathan-chansin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pkg/chi-middleware/oapi_validate.go
Outdated
|
|
||
| // OapiRequestValidatorWithOptions Creates middleware to validate request by swagger spec. | ||
| // shouldWarnAboutServers checks if a warning about the `Servers` field in the OpenAPI spec should be logged. | ||
| func shouldWarnAboutServers(swagger *openapi3.T, options *Options) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand why you did this, but I would keep the code as close as possible to the original code
This PR:
This is needed in https://github.com/clinia/atlas/pull/1683. The validator was disabled since 1.0.6. Latest is at 1.0.10.
Tests:

OAPI:
Atlas: