Wrap Chi server and pass parameters as function params#166
Merged
deepmap-marcinr merged 5 commits intooapi-codegen:masterfrom Jul 20, 2020
Merged
Wrap Chi server and pass parameters as function params#166deepmap-marcinr merged 5 commits intooapi-codegen:masterfrom
deepmap-marcinr merged 5 commits intooapi-codegen:masterfrom
Conversation
Contributor
|
This is something that's come up in the past #56 (comment) and looks like a decent change 👍 |
Contributor
|
Awesome improvement 👍 . But unfortunately this is a breaking change. I'm not sure if this project uses semver, but it would be nice if you could release this as major change instead as patch the next time. |
Contributor
|
This project is in an interesting place. It's a code generator, with a
small runtime. I've been strict about semver with anything under
pkg/runtime, since a simple "go get -u" should not break existing generated
code. However, many changes to code generation are breaking changes. If I
treated this as a runtime for semver purposes, I'd probably be on
oapi-codegen/v50 right now, and not quite sure how bug fixes would work
across so many versions.
Anyhow, I'm open to suggestions how to manage it better, but it's been
challenging. I've been thinking of creating a V2 in the near future which
is severely incompatible, because some improvements would create very
difficult refactorings for users, and I've been avoiding those. In
retrospect, I should have insisted that Chi handlers looked like Echo
handlers from the beginning.
…On Fri, Jul 24, 2020 at 1:25 AM Peter Golm ***@***.***> wrote:
Awesome improvement 👍 . But unfortunately this is a breaking change. I'm
not sure if this project uses semver, but it would be nice if you could
release this as major change instead as patch the next time.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#166 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALKC5DAQXOGAZDS5IW5X3BLR5FARFANCNFSM4L2MXQXQ>
.
|
Contributor
|
It broke our pipeline as well. We should try and avoid breaking changes to be introduced without updating the major version. Or find another alternative. |
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.
Wrap the Chi server in the same way it is being done with Echo:
This way the resulting code is more symmetric with Echo and path parameters can be obtained with consulting opaque context values.
The
http.ResponseWriterandhttp.Requestare still passed to the server interface because the server is still responsible of writing the response and not all entities are yet managed by the auto generated code, such as decoding therequest.Body.