Skip to content

Update echo V5 petstore example#2442

Merged
mromaszewicz merged 1 commit into
mainfrom
chore/update-example
Jul 9, 2026
Merged

Update echo V5 petstore example#2442
mromaszewicz merged 1 commit into
mainfrom
chore/update-example

Conversation

@mromaszewicz

Copy link
Copy Markdown
Member

Now that we have echo V5 middleware, use it, rather than recreating it locally.

@mromaszewicz
mromaszewicz requested a review from a team as a code owner July 9, 2026 16:52
@socket-security

socket-security Bot commented Jul 9, 2026

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.2.172100100100100
Addedgithub.com/​oapi-codegen/​echo-v5-middleware@​v0.1.0100100100100100

View full report

@socket-security

socket-security Bot commented Jul 9, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

  • golang.org/x/tools@v0.47.0

View full report

@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes the locally-inlined echo-v5 OpenAPI validation middleware (which existed as a workaround until a published package was available) and replaces it with the now-published github.com/oapi-codegen/echo-v5-middleware package. The call site in setup.go is unchanged beyond the import path.

  • middleware/middleware.go (226 lines) is deleted; setup.go swaps the import alias to github.com/oapi-codegen/echo-v5-middleware with no other changes.
  • go.mod adds echo-v5-middleware v0.1.0 as a direct dependency (correctly placed in the direct block) and bumps labstack/echo/v5 from v5.1.0 to v5.2.1, with cascading indirect dependency updates from go mod tidy.

Confidence Score: 5/5

Safe to merge — the change removes a temporary workaround and replaces it with the published package it was always meant to defer to, with no logic changes at the call site.

The change is a straightforward dependency substitution: the locally-inlined middleware is deleted and the now-published equivalent is imported instead. The exported function name (OapiRequestValidator) and call signature are identical, so no downstream code is affected. Indirect dependency bumps are the natural result of go mod tidy after adding the new direct dependency.

No files require special attention.

Important Files Changed

Filename Overview
examples/petstore-expanded/echo-v5/middleware/middleware.go Deleted: the 226-line locally-inlined echo-v5 middleware (written as a temporary workaround until a published package existed) is removed entirely, replaced by the now-published oapi-codegen/echo-v5-middleware package.
examples/petstore-expanded/echo-v5/server/setup.go Import swapped from the deleted local middleware package to github.com/oapi-codegen/echo-v5-middleware; the call site (mw.OapiRequestValidator) is unchanged and the exported symbol name matches.
examples/go.mod Adds github.com/oapi-codegen/echo-v5-middleware v0.1.0 as a direct dependency (correctly placed in the direct block), bumps labstack/echo/v5 from v5.1.0 to v5.2.1, and updates several indirect dependencies pulled in transitively.
examples/go.sum Checksum file updated to match go.mod changes; no anomalies.

Reviews (2): Last reviewed commit: "Update echo V5 petstore example" | Re-trigger Greptile

Comment thread examples/go.mod Outdated
Now that we have echo V5 middleware, use it, rather than recreating
it locally.
@mromaszewicz
mromaszewicz force-pushed the chore/update-example branch from f05db39 to 962422c Compare July 9, 2026 16:55
@mromaszewicz

Copy link
Copy Markdown
Member Author

The socket security warning is a false positive. I'm trying to find how to squelch that in the future in their settings.

@mromaszewicz

Copy link
Copy Markdown
Member Author

@SocketSecurity ignore golang/golang.org/x/tools@v0.47.0

@mromaszewicz mromaszewicz added the chore Any maintenance tasks that are regular, not as important to call out in the changelog label Jul 9, 2026
@mromaszewicz
mromaszewicz merged commit 90bd665 into main Jul 9, 2026
29 checks passed
@mromaszewicz
mromaszewicz deleted the chore/update-example branch July 9, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Any maintenance tasks that are regular, not as important to call out in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant