Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(go): Add inlinePathParameters configuration #5244

Merged
merged 7 commits into from
Nov 21, 2024

Conversation

amckinney
Copy link
Contributor

This adds the new inlinePathParameters configuration option so that users can generate their in-lined request types to contain the path parameters specified by the endpoint (which are generated as positional parameters by default).

With this, users are now presented with path parameter endpoint signatures that look like the following:

func (c *Client) GetUser(
	ctx context.Context,
	request *acme.GetUserRequest,
	opts ...option.RequestOption,
) error {
        ...
}

Note that this also updates a couple other minor details:

  1. Updates the Dynamic IR to contain the includePathParameters and onlyPathParameters fields in the InlinedRequest.
  2. Updates the DynamicSnippetsGenerator to fix the dynamic snippets produced when this configuration is toggled.
    • Note that a follow-up is required to use the new configuration introduced in the PR here (denoted by a TODO).
  3. Updates the AbstractDynamicSnippetGeneratorContext to reference the same IR version.
    • This is a temporary fix - in a follow-up, we'll remove the constraint that the two IR versions are consistent between these packages.

@amckinney amckinney requested a review from dsinghvi as a code owner November 21, 2024 18:48
Copy link

github-actions bot commented Nov 21, 2024

@amckinney amckinney enabled auto-merge (squash) November 21, 2024 19:34
@amckinney amckinney merged commit cf894f0 into main Nov 21, 2024
58 of 62 checks passed
@amckinney amckinney deleted the amckinney/go/inline-path-parameters branch November 21, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants