Modernize + make more consistent with net/http#38
Merged
mromaszewicz merged 12 commits intomainfrom Feb 7, 2026
Merged
Conversation
Member
Author
This comment was marked as resolved.
This comment was marked as resolved.
As it's been OpenAPI for a while. Related: https://togithub.com/oapi-codegen/oapi-codegen/issues/672
The code at the time was still copyright to DeepMap, but since the move, is updated to the oapi-codegen contributors.
As a means to provide a full example of usage, we can use a testable example.
When a route is correctly matched, but the HTTP method used does not, we should return an HTTP 405 Method Not Allowed. However, in our previous implementation, we would always return an HTTP 404 Not Found, which is incorrect. Instead, we can match on whether we have received an `ErrMethodNotAllowed` and if so, return the correct HTTP 405.
As some folks may not want to perform the workaround of having to mangle their `spec.Servers`, as well as removing potentially noisy log lines.
But we won't really indicate /what/ "supported" means at this time.
1b95c1b to
654278a
Compare
mromaszewicz
approved these changes
Feb 7, 2026
Member
mromaszewicz
left a comment
There was a problem hiding this comment.
Looks good. Claude did well too :)
Main thing I looked for was breaking API changes, and it's just additional options and API contract is as it was, so good to go.
Thank you.
Member
|
Actually, the change with regards to HTTP/405 worries me a little bit, since it's a behavior change. Anyone who updates their server will see this change. I think it's ok, though, because they can pin an older version without that change. I'll re-word the commit message to put that change first. |
Member
Author
|
I'd meant for this to be rebase merged 🙃 |
Member
Author
|
We did the same change on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This takes a number of changes from the last couple of years that we've done on our
net/httpmiddleware.This will then allow us to take on contributions more easily, as well as look at cross-middleware options.