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 support for file upload dynamic snippets #5252

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

amckinney
Copy link
Contributor

@amckinney amckinney commented Nov 22, 2024

This updates Go's DynamicSnippetsGenerator so that it supports file upload snippets, and considers both the inlineFileProperties and inlinePathParameters configuration options.

For example, given the following request:

{
  endpoint: {
      method: "POST",
      path: "/just-file-with-query-params"
  },
  auth: undefined,
  pathParameters: undefined,
  queryParameters: {
      integer: 42,
      maybeString: "exists"
  },
  headers: undefined,
  requestBody: {
      file: "Hello, world!"
  }
}

The corresponding Go snippet with inlineFileProperties is shown below:

package example

import (
	context "context"
	acme "github.com/acme/acme-go"
	client "github.com/acme/acme-go/client"
	strings "strings"
)

func do() {
	client := client.NewClient()
	client.Service.JustFileWithQueryParams(
		context.TODO(),
		&acme.JustFileWithQueryParamsRequet{
			Integer: 42,
			MaybeString: acme.String(
				"exists",
			),
			File: strings.NewReader(
				"Hello, world!",
			),
		},
	)
}

Copy link

github-actions bot commented Nov 22, 2024

@amckinney amckinney marked this pull request as ready for review November 22, 2024 03:26
@amckinney amckinney changed the title feat(go): [WIP] Add support for file upload dynamic snippets feat(go): Add support for file upload dynamic snippets Nov 22, 2024
@amckinney amckinney merged commit d594089 into main Nov 22, 2024
57 of 60 checks passed
@amckinney amckinney deleted the amckinney/go/file-upload branch November 22, 2024 14:06
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