Skip to content

fix: Change FormParams to FormValues for Echo v5#2311

Merged
mromaszewicz merged 1 commit into
oapi-codegen:mainfrom
nicolasmattelaer:main
Apr 3, 2026
Merged

fix: Change FormParams to FormValues for Echo v5#2311
mromaszewicz merged 1 commit into
oapi-codegen:mainfrom
nicolasmattelaer:main

Conversation

@nicolasmattelaer

Copy link
Copy Markdown
Contributor

In Echo v5, ctx.FormParams() seems to have been deprecated in favor of ctx.FormValues(), which has the same signature. The code generation, when echo v5 was specified, was generating code with.FormParams() and not .FormValues(), leading to an error in the generated code.

@nicolasmattelaer nicolasmattelaer requested a review from a team as a code owner April 2, 2026 12:50
@mromaszewicz

Copy link
Copy Markdown
Member

@greptileai

@greptile-apps

greptile-apps Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a bug in the Echo v5 strict handler template where ctx.FormParams() was used instead of the Echo v5 equivalent ctx.FormValues(), which caused a compilation error in generated code when using Echo v5 with form data request bodies.

  • Single-line fix in pkg/codegen/templates/strict/strict-echo5.tmpl: replaces ctx.FormParams() with ctx.FormValues() on the generated form data handling path.
  • The fix is consistent with Echo v5's API — FormValues() has the same return signature (url.Values, error) as FormParams() had in Echo v4, so the surrounding binding logic (runtime.BindForm) works unchanged.
  • The non-v5 template (strict-echo.tmpl) correctly retains ctx.FormParams() for Echo v4 compatibility.
  • No test coverage exists for the Echo v5 strict handler with form data bodies (there is no internal/test/strict-server/echo5/ test directory), so this change is not directly validated by an integration test. Adding a golden-file or integration test for this code path would help prevent regressions.

Confidence Score: 4/5

This PR is safe to merge; the fix is a minimal, targeted API rename with no logic changes.

The change is a straightforward one-line substitution of a deprecated Echo v5 API call. The return type and usage pattern are identical, so downstream code (runtime.BindForm) remains correct. The main gap is the absence of an integration test specifically covering the Echo v5 strict handler with form-data bodies, meaning regressions would not be caught automatically, which keeps the score from being a 5.

No files require special attention beyond pkg/codegen/templates/strict/strict-echo5.tmpl.

Important Files Changed

Filename Overview
pkg/codegen/templates/strict/strict-echo5.tmpl Replaces the deprecated ctx.FormParams() with ctx.FormValues() for Echo v5 form data handling in the strict handler template.

Reviews (1): Last reviewed commit: "change FormParams to FormValues" | Re-trigger Greptile

@mromaszewicz mromaszewicz added the bug Something isn't working label Apr 3, 2026
@mromaszewicz mromaszewicz merged commit e126f5a into oapi-codegen:main Apr 3, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto:no-head-branch bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants