You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validate with x-oapi-codegen-extra-tags do not work for query params #2232
Thanks for reporting this! After investigating, x-oapi-codegen-extra-tags on query parameters does work — the extension is supported at both the parameter level and the schema level, and both are merged into the generated *Params struct fields.
The YAML in the issue appears to have indentation issues, which would cause the extension to not be associated with the parameter correctly. Here are two correct ways to use it:
At the parameter level:
paths:
/v1/your/endpoint:
get:
parameters:
- name: envin: queryrequired: truex-oapi-codegen-extra-tags:
validate: "required,oneof=dev live"schema:
type: stringenum:
- dev
- live
Both will produce a *Params struct field with the validate tag. If you're still seeing issues with correctly-indented YAML, please reopen with a minimal reproducible spec and the generated output.
Activity
fix: support x-oapi-codegen-extra-tags on parameter schemas (oapi-cod…
fix: support x-oapi-codegen-extra-tags on parameter schemas (#2232) (#…
mromaszewicz commentedon Feb 28, 2026
Thanks for reporting this! After investigating,
x-oapi-codegen-extra-tagson query parameters does work — the extension is supported at both the parameter level and the schema level, and both are merged into the generated*Paramsstruct fields.The YAML in the issue appears to have indentation issues, which would cause the extension to not be associated with the parameter correctly. Here are two correct ways to use it:
At the parameter level:
At the schema level (inside the parameter):
Both will produce a
*Paramsstruct field with thevalidatetag. If you're still seeing issues with correctly-indented YAML, please reopen with a minimal reproducible spec and the generated output.