Open
Conversation
Add echov5openapi adapter supporting Echo v5 breaking changes: - *echo.Context pointer-based handlers - echo.RouteInfo return type instead of *echo.Route - http.Method* constants instead of echo.* constants - nil handler guard (Echo v5 panics on nil handlers) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Hey @adaosantos @akfaiz — this PR adds an Echo v5 adapter following the same pattern as the existing adapters ( However, I noticed your discussion in #42 about adapter versioning strategy and the Datadog-style approach ( How do you think we should handle this here? A few options:
Would love to align on this before merging. What's your preference? |
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.
Summary
echov5openapiadapter to support Echo v5, which introduced several breaking changes from v4 (pointer*echo.Context,RouteInforeturn types,log/sloglogger, etc.)echoopenapiadapter continues to work for Echo v4 usersWhat's included
adapter/echov5openapi/— full adapter implementation:router.go— Router/Generator with all HTTP method handlers, route groups, middleware, static file serving, and OpenAPI doc endpointsroute.go— Route wrapper bridging Echo v5RouteInfowithspec.Routetypes.go—Generator,Router, andRouteinterfaces matching the Echo v5 APIrouter_test.go— comprehensive tests covering all HTTP methods, groups, middleware, schema generation, validation, and edge casesexamples/basic/— working example with auth middlewareREADME.MD— documentation with quick start, migration guide from v4, and API referenceadapter/README.mdto list both Echo v4 and Echo v5 adaptersgo.workto include the new moduleEcho v5 breaking changes handled
echo.Context(interface)*echo.Context(pointer)*echo.Routeecho.RouteInfo(struct).Method,.Path,.Namemethods.Method,.Path,.NamefieldsStatic(prefix, root)Static(prefix, root, ...middleware)echo.Loggerlog/slogHow to test
This was developed using Claude Code. To test before this is merged, you can use Go module replacements in your
go.mod:🤖 Generated with Claude Code