fix: support x-oapi-codegen-extra-tags on path params in strict-server RequestObject#2262
Conversation
6972e13 to
d2772e8
Compare
d2772e8 to
2025eb8
Compare
…r RequestObject ParameterDefinition.JsonTag() only produced a `json:"..."` tag and ignored x-oapi-codegen-extra-tags. This meant path parameters in strict-server RequestObject structs never included extra struct tags, even though query/header/cookie parameters did (via GenerateParamsTypes). Update JsonTag() to read x-oapi-codegen-extra-tags from both the parameter and schema levels, with parameter-level taking precedence, matching the existing merge behavior in GenerateParamsTypes(). Fixes oapi-codegen#2261 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2025eb8 to
847734f
Compare
Greptile SummaryThis PR extends Confidence Score: 4/5Safe to merge; the only finding is a minor documentation/guard concern consistent with existing codebase patterns. Only P2 findings present. The implementation is correct, nil-safe, and consistent with the existing schema.go handling of the same extension. No files require special attention.
|
| Filename | Overview |
|---|---|
| pkg/codegen/operations.go | Extends JsonTag() to merge x-oapi-codegen-extra-tags from schema and parameter levels; logic mirrors the existing schema.go implementation and is otherwise correct. |
| pkg/codegen/operations_test.go | Adds thorough unit tests for the new JsonTag() behaviour, covering required/optional, schema-level, parameter-level, and precedence cases. |
Reviews (1): Last reviewed commit: "fix: support x-oapi-codegen-extra-tags o..." | Re-trigger Greptile
No description provided.