-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Open
Labels
type/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.
Description
Feature Description
Disclaimer: I'm working on it currently to see if it's doable and so far I think it is. If this gets accepted I'd like to author it.
I'd like to suggest dropping go-swagger based generation in favor of automatically generated docs from code with huma
This would bring following benefits:
- No need to update swagger comments
- Always up to date spec with current api
- Autogenerated openapi 3.1 and 3.0 (in both json and yaml formats) plus json schema for it
- Works with chi and few other frameworks/routers so it's more portable
Downsides:
- A rather larger work to get this up
- Drops openapi 2.0 support unless we also provide a converter for it
- Some endpoints might be harder to convert (but could possibly be registered anyway despite not being managed by huma)
- Contexts would need to be examined as function signature is
func (context.Context, *struct) (*struct, error)
, context being the std lib one.1
Screenshots
No response
Footnotes
-
Semi related: I find current router system with multiple different functions and contexts being accepted really confusing so maybe it's an area that can be simplified a bit? ↩
silverwind
Metadata
Metadata
Assignees
Labels
type/proposalThe new feature has not been accepted yet but needs to be discussed first.The new feature has not been accepted yet but needs to be discussed first.