-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
WIP: OpenAPIServable #344
base: main
Are you sure you want to change the base?
WIP: OpenAPIServable #344
Conversation
dd41e92
to
5185b88
Compare
196fd08
to
10f7cff
Compare
10f7cff
to
8b4e56d
Compare
This is ready to review. I did elect to wrap our engine in the gin Adaptor struct but it's not necessary as you can see. It just felt nicer to me (this piece isn't necessarily done mainly just would like some feedback). We could change route constructors as well it would align with the way our func GetGin(a *Adaptor, path string, handler gin.HandlerFunc, options ...func(*fuego.BaseRoute)) *fuego.Route[any, any] {
return handleGin(a, http.MethodGet, path, handler, options...)
} We could leave the Engine out but the type OpenAPIServable interface {
SpecHandler(e *Engine)
UIHandler(e *Engine)
} We could then make In order to really go much further in unifying our server with the adaptors is we're gonna have to get closer to actually running the Server start, and maybe it's not even worth it. Really the only thing we don't provide at this point is I plan to add comments/test after we decide if this looks goods/is worthwhile. |
253ac48
to
b6d9ea6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly the best PR of the month. Made my day :)
No big comment on the structure of your PR, it was really nice to see all this!
I'm mostly discussing about the API we will show to our users. This might seem superficial but it is essential when designing a framework, this will impact user adoption a lot.
Feel free to challenge my propositions :)
@EwenQuim @ccoVeille thank you all for the review. I'll try to get this update with the suggestions before then end of the week. If you need this done sooner please feel free to add additions or open another PR against this. I am low on time for next week or two. |
Oh and please let me know if you have other thoughts. This PR was tough as I believe approaching a more of a decision on how much do we want to fuego to responsible for. To me the real spirit of the PR is just providing some components for serving OpenAPI Routes that's easy (essentially these integrations with other frameworks should provide routes to serve these resources to me it's one of the flagships of the product). The 2nd thing is getting all the config for OpenAPIConfig into Engine. Having to split between Server and Engine feels just wrong. |
2d456ed
to
cbd0157
Compare
OpenAPIConfig [skip ci] fuegogin.NewAdaptor WIP
cbd0157
to
b92ebe4
Compare
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
51bc48e
to
ba6af88
Compare
This is ready for another look btw 😄 |
Heavy WIP
Working through how this would work.
Just wanted to get a initial outline on how we could do this. Feel free to discuss over top of this. I imagine we reach the point with our adaptors where we have something like
fuegogin.Adaptor.Run()
, in this case it wouldengine.OutputOpenAPISpec
,engine.RegisterOpenAPIRoutes
, and then start the gin server. Again everything is exposed and we can provide options maybe, but users can plug and play as they please.PS. Feel free to open PR against this or contribute directly 😄