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 inlineFileProperties configuration #5202

Merged
merged 6 commits into from
Nov 18, 2024
Merged

Conversation

amckinney
Copy link
Contributor

This adds the new inlineFileProperties configuration option so that users can generate their in-lined request types to contain the io.Reader file properties (which are generated as positional parameters by default).

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

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

Note that this also updates a couple other minor details:

  1. Updates the internal.MultipartWriter abstraction to expose a WithDefaultContentType option.
    • This is primarily meant to simplify the generated code.
  2. Fix an issue where the internal.MultipartWriter utilities were unnecessarily generated for SDKs that don't define any multipart/form-data endpoints.

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

github-actions bot commented Nov 18, 2024

@amckinney amckinney merged commit 5ab9590 into main Nov 18, 2024
60 checks passed
@amckinney amckinney deleted the amckinney/go/file branch November 18, 2024 22:22
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