-
-
Notifications
You must be signed in to change notification settings - Fork 936
Better document/warn requirement for unsetting doc.Servers
#882
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
Comments
jamietanna
pushed a commit
that referenced
this issue
Dec 1, 2022
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
pushed a commit
that referenced
this issue
Dec 17, 2022
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.
adrianpk
pushed a commit
to foorester/oapi-codegen
that referenced
this issue
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 issue
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 issue
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
In https://github.com/deepmap/oapi-codegen/blob/5a337911b060aad7130b05ad1819cfd3b73884f4/examples/petstore-expanded/gin/petstore.go#L26-L28, and other cases we're getting the Middleware
I recommend we log a warning if we see that
Servers != nil
.This won't break anyone's builds or expectations if they're needing it, but will make it clear that this could be a problem.
It's a problem I've hit several times and so have others I've worked with, so we should try and preemptively alert folks!
The text was updated successfully, but these errors were encountered: