Skip to content

feat: Support echo/v5#2188

Merged
mromaszewicz merged 7 commits intooapi-codegen:mainfrom
jinuthankachan:feat/echov5-support
Mar 3, 2026
Merged

feat: Support echo/v5#2188
mromaszewicz merged 7 commits intooapi-codegen:mainfrom
jinuthankachan:feat/echov5-support

Conversation

@jinuthankachan
Copy link
Copy Markdown
Contributor

@jinuthankachan jinuthankachan commented Jan 21, 2026

@jinuthankachan jinuthankachan changed the title feat/echov5-support feat: Support echo/v5 Jan 22, 2026
@DanDagadita
Copy link
Copy Markdown
Contributor

Thank you for the PR, just two minor issues:

  • I don't understand why you use ctx.PathParam instead of ctx.Param (in pkg/codegen/templates/echo/v5/echo-wrappers.tmpl), I cannot find the PathParam method anywhere; it's not in v4 nor in v5 of Echo's Context. Upon generating an endpoint containing path parameters, it fails to compile due to the method not existing.
  • Another small thing, the options you added can also be added to oapi-config-schema.json (under properties -> generate -> properties).

jinuthankachan and others added 2 commits February 21, 2026 18:27
* feat/echov5-codegen (#6)
* server code generation for echo/v5
* does not include:
    - strict-server for echo/v5
    - middlewares for echo/v5
@shonigbaum
Copy link
Copy Markdown

shonigbaum commented Mar 3, 2026

Hey guys,
any news on this? Or maybe even a approx. date when this will be done?

@mromaszewicz
Copy link
Copy Markdown
Member

Hey guys, any news on this? Or maybe even a approx. date when this will be done?

This PR isn't ready to go, we can't merge a half complete feature. I've checked it out and I'm amending it.

@mromaszewicz mromaszewicz added this to the v2.7.0 milestone Mar 3, 2026
@mromaszewicz mromaszewicz added the enhancement New feature or request label Mar 3, 2026
jinuthankachan and others added 3 commits March 4, 2026 00:08
* fix: add the missing strict server generation
Instead of hardcoding each router's framework and strict middleware
imports directly in imports.tmpl with per-router conditional blocks,
compute them in Go code via GenerateOptions.RouterImports() and pass
them to the template as RouterImports. The template now uses a single
range loop over .RouterImports, making it straightforward to add new
routers without touching the template.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Echo v5 version of the petstore-expanded example, in its own Go module
(go 1.25.0) to avoid bumping the Go version of the shared examples module.

Key differences from the echo (v4) example:
- *echo.Context (pointer) instead of echo.Context (interface)
- echo.NewHTTPError(code, message) takes exactly two args
- No HTTPError.Internal field
- EchoRouter returns echo.RouteInfo instead of *echo.Route
- log.Fatal(e.Start(...)) instead of e.Logger.Fatal(...)

Includes an inline OpenAPI request validation middleware (middleware/)
adapted from echo-middleware for echo v5, since no published echo-v5
middleware package exists yet.

Models and server stubs are placeholders until the codegen circular
dependency for go:generate in isolated modules is resolved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jinuthankachan jinuthankachan marked this pull request as ready for review March 3, 2026 18:57
@jinuthankachan jinuthankachan requested a review from a team as a code owner March 3, 2026 18:57
The echo-v5 example requires Go 1.25+ (for echo/v5). When CI runs
with GOTOOLCHAIN=local on Go 1.24, the module refuses to build.

Add a Go version guard to the Makefile so all targets skip gracefully
with an informational message on older Go versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgithub.com/​labstack/​echo/​v5@​v5.0.472100100100100

View full report

@mromaszewicz mromaszewicz merged commit 717f462 into oapi-codegen:main Mar 3, 2026
35 of 37 checks passed
@jinuthankachan jinuthankachan deleted the feat/echov5-support branch March 4, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for echo/v5

4 participants