-
Notifications
You must be signed in to change notification settings - Fork 806
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
Not possible to create Router without framework #525
Comments
Do you mean dependencies in terms of our own However, if you generate a chi server with minimal options, the generated code should not have that many dependencies, but our My goal initially was to have the generated files be self contained, but I've not had time to do that, and other people's packages solve really hard problems, like request validation. |
We could look at producing a net/http router, for as limited a router as possible, but chi/gorilla provide a much better experience that I'd recommend it if possible. |
IMO, this is one of those "opinionated" decisions that make a lot of other things easier. People have built fantastic http Routers, and it's a duplication of effort to re-create that here, spending years re-learning their mistakes. I originally started with echo after having heavily used Gin/Echo. I chose Echo over Gin because the Context in Echo is an interface, and easier to mock for various reasons, while it's a struct pointer in Gin. Then, others added different routers like Chi. For minimal dependencies, you could use the code to generate only the models, and simply unmarshal from JSON yourself, no routing frameworks required at runtime. |
This will be closed when #1068 is implemented |
Hello,
My team is trying to have as less depencies as possible and currently it seems not to be possible to generate code that does not have any routing frameworks.
I really like your project but one idiom of GO is to have as less dependencies that possible.
Is there a way to accomplish that with oapi-codegen or is using chi-router the next best thing?
The text was updated successfully, but these errors were encountered: