Skip to content

feat: name a parameter in Go by its x-go-name - #96

Merged
MarkRosemaker merged 1 commit into
mainfrom
feat/param-go-name
Nov 27, 2026
Merged

MarkRosemaker merged 1 commit into
mainfrom
feat/param-go-name

Conversation

@MarkRosemaker

Copy link
Copy Markdown
Owner

Problem: a parameter's Go name always came from its wire name. IBKR Flex's q, t and v therefore became the fields Q, T and V.

Change: fromParam now names a query, path or header parameter by its x-go-name when it has one, and requests still use the wire name. This matches how x-go-name already names schemas and properties. The name sets the struct field, the path argument and the local variable. Path parameters still get the Param suffix when needed.

Golden testdata:

  • GetStatement's query parameter q has "x-go-name": "ReferenceCode", so the field is GetStatementParams.ReferenceCode. The generated test sets that field and checks that the request sends ?q=, and the XML replay still passes.
  • getPage's path parameter id has "x-go-name": "PageID", so the client is GetPage(ctx, pageID string) and the server reads r.PathValue("id") into pageID.

Docs: the README features and the roadmap mention the new behavior.

make ready passes.


Generated by Claude Code

A parameter's Go name always came from its wire name, so IBKR's q, t and
v became the fields Q, T and V. Now an x-go-name on a query, path or
header parameter names its field, argument and variable, as it already
names schemas and properties, while requests keep the wire name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QCb1AfnATvpBQCH3PrX7Y
@MarkRosemaker
MarkRosemaker merged commit b02a6fc into main Nov 27, 2026
1 check passed
@MarkRosemaker
MarkRosemaker deleted the feat/param-go-name branch November 27, 2026 17:07
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