-
Notifications
You must be signed in to change notification settings - Fork 161
Feature request: x-ogen-name extension for parameters #1593
Copy link
Copy link
Closed
Description
Use Case
When generating Go code, I'd like to customize the Go field name for a parameter independently of its OpenAPI name.
Current Behavior
The x-ogen-name extension works for schema types and x-ogen-properties works for struct fields within schemas, but there's no equivalent for operation parameters.
parameters:
- name: pickuptype
in: path
schema:
type: stringGenerates:
type MyOperationParams struct {
Pickuptype string
}Desired Behavior
Support x-ogen-name (or a new x-ogen-param-name) on parameters:
parameters:
- name: pickuptype
in: path
x-ogen-name: CancelBy
schema:
type: stringWould generate:
type MyOperationParams struct {
CancelBy string
}Motivation
This allows preserving semantic meaning in generated Go code when the OpenAPI parameter name doesn't match the desired Go identifier, similar to how x-ogen-properties allows renaming struct fields.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels