Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWrap Chi server and pass parameters as function params #166
Conversation
|
This is something that's come up in the past #56 (comment) and looks like a decent change |
e232d16
into
deepmap:master
|
Awesome improvement |
|
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
|
|
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. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

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.