Repository navigation
feat: name a parameter in Go by its x-go-name - #96
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: a parameter's Go name always came from its wire name. IBKR Flex's
q,tandvtherefore became the fieldsQ,TandV.Change:
fromParamnow names a query, path or header parameter by itsx-go-namewhen it has one, and requests still use the wire name. This matches howx-go-namealready names schemas and properties. The name sets the struct field, the path argument and the local variable. Path parameters still get theParamsuffix when needed.Golden testdata:
GetStatement's query parameterqhas"x-go-name": "ReferenceCode", so the field isGetStatementParams.ReferenceCode. The generated test sets that field and checks that the request sends?q=, and the XML replay still passes.getPage's path parameteridhas"x-go-name": "PageID", so the client isGetPage(ctx, pageID string)and the server readsr.PathValue("id")intopageID.Docs: the README features and the roadmap mention the new behavior.
make readypasses.Generated by Claude Code