Skip to content

Conversation

@Radududu
Copy link
Member

@Radududu Radududu commented May 26, 2025

This PR:

  • Adds the return statement back.
  • Adds the commented tests back.
  • Adds and fixes linting rules based on the Atlas repo

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:
image

Atlas:

@Radududu Radududu added the enhancement New feature or request label May 26, 2025
Comment on lines 101 to 107
// 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
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New explanation comment

@Radududu Radududu marked this pull request as draft June 2, 2025 18:30
@Radududu Radududu marked this pull request as ready for review June 2, 2025 20:43
Copy link

@jonathan-chansin jonathan-chansin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


// 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 {

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

@Radududu Radududu merged commit ac1fbae into hard-fork Jun 10, 2025
9 checks passed
@Radududu Radududu deleted the feat/reenable-oapi-validator branch June 10, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants