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

Warn when using a non-empty spec.Servers #883

Merged
merged 1 commit into from
Dec 17, 2022

Conversation

jamietanna
Copy link
Member

It's a fairly common mistake when using the OpenAPI request validation
filter from kin-openapi to receive no matching operation was found
errors if using the servers directive in your OpenAPI specification.

This is a valid usescase, but you may not always want to be enforcing
the validation that the Host header matches one of the servers
mentioned in your specification.

This makes it clearer to operators that there may be a configuration
issue here, as a way to avoid as many folks falling into the same trap
that many have before.

This also provides an option to silence the warning, as logging out can
be annoying and costly.

Closes #882.

It's a fairly common mistake when using the OpenAPI request validation
filter from kin-openapi to receive `no matching operation was found`
errors if using the `servers` directive in your OpenAPI specification.

This is a valid usescase, but you may not always want to be enforcing
the validation that the `Host` header matches one of the `servers`
mentioned in your specification.

This makes it clearer to operators that there may be a configuration
issue here, as a way to avoid as many folks falling into the same trap
that many have before.

This also provides an option to silence the warning, as logging out can
be annoying and costly.

Closes #882.
@deepmap-marcinr deepmap-marcinr merged commit 6c80420 into master Dec 17, 2022
@jamietanna jamietanna deleted the doc/middleware-servers branch December 18, 2022 20:29
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
It's a fairly common mistake when using the OpenAPI request validation
filter from kin-openapi to receive `no matching operation was found`
errors if using the `servers` directive in your OpenAPI specification.

This is a valid usescase, but you may not always want to be enforcing
the validation that the `Host` header matches one of the `servers`
mentioned in your specification.

This makes it clearer to operators that there may be a configuration
issue here, as a way to avoid as many folks falling into the same trap
that many have before.

This also provides an option to silence the warning, as logging out can
be annoying and costly.

Closes oapi-codegen#882.
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
It's a fairly common mistake when using the OpenAPI request validation
filter from kin-openapi to receive `no matching operation was found`
errors if using the `servers` directive in your OpenAPI specification.

This is a valid usescase, but you may not always want to be enforcing
the validation that the `Host` header matches one of the `servers`
mentioned in your specification.

This makes it clearer to operators that there may be a configuration
issue here, as a way to avoid as many folks falling into the same trap
that many have before.

This also provides an option to silence the warning, as logging out can
be annoying and costly.

Closes oapi-codegen#882.
danicc097 pushed a commit to danicc097/oapi-codegen that referenced this pull request Aug 31, 2024
It's a fairly common mistake when using the OpenAPI request validation
filter from kin-openapi to receive `no matching operation was found`
errors if using the `servers` directive in your OpenAPI specification.

This is a valid usescase, but you may not always want to be enforcing
the validation that the `Host` header matches one of the `servers`
mentioned in your specification.

This makes it clearer to operators that there may be a configuration
issue here, as a way to avoid as many folks falling into the same trap
that many have before.

This also provides an option to silence the warning, as logging out can
be annoying and costly.

Closes oapi-codegen#882.
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 this pull request may close these issues.

Better document/warn requirement for unsetting doc.Servers
2 participants