Skip to content

feat: support query and param struct tags for Echo framework compatibility#2154

Merged
sdghchj merged 1 commit into
swaggo:masterfrom
maxclaus:support-echo-query-param-tags
Mar 19, 2026
Merged

feat: support query and param struct tags for Echo framework compatibility#2154
sdghchj merged 1 commit into
swaggo:masterfrom
maxclaus:support-echo-query-param-tags

Conversation

@maxclaus

Copy link
Copy Markdown
Contributor

Describe the PR
Add support for query and param struct tags when generating parameter names from structs:

  • query tag overrides the name for query params (taking priority over the form tag fallback)
  • param tag overrides the name for path params (same role as uri, which takes priority if both are present)

Both tags respect "-" to skip fields. This allows Echo users to use their native struct tags without needing to duplicate uri or form tags solely for swag compatibility.

Relation issue
#2093

Additional context
Echo framework uses query:"<name>" for query parameters and param:"<name>" for path parameters: https://echo.labstack.com/docs/binding.

Without this change, swag ignores those tags and falls back to the camelCased field name, producing e.g. projectID instead of projectId for a field named ProjectID.

@sdghchj sdghchj merged commit 652e82c into swaggo:master Mar 19, 2026
12 checks passed
@maxclaus

Copy link
Copy Markdown
Contributor Author

@sdghchj thanks for the quick approval. May I ask when you plan to run a new release?

@maxclaus maxclaus deleted the support-echo-query-param-tags branch March 19, 2026 22:38
@sdghchj

sdghchj commented Mar 20, 2026

Copy link
Copy Markdown
Member

@sdghchj thanks for the quick approval. May I ask when you plan to run a new release?

Any time after a number of PRs have been collected since last release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants