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

(feature, ts): Add inlineFileProperties configuration #3661

Merged
merged 6 commits into from
May 21, 2024
Merged

Conversation

amckinney
Copy link
Collaborator

@amckinney amckinney commented May 20, 2024

This adds the inlineFileProperties configuration to support generating file upload properties as in-lined request properties (instead of positional parameters). Simply configure the following:

- name: fernapi/fern-typscript-node-sdk
  version: 0.19.0
  ...
  config:
    inlineFileProperties: true

The generated code will nested the file properties in the in-lined request like so:

/**
  * @param {Acme.MyRequest} request
  * @param {Service.RequestOptions} requestOptions - Request-specific configuration.
  *
  * @example
  *     await client.service.post({
  *        file: fs.createReadStream("/path/to/your/file"),
  *        fileList: [fs.createReadStream("/path/to/your/file")]
  *     })
  */
public async post(
    request: Acme.MyRequest,
    requestOptions?: Service.RequestOptions
): Promise<void> {
  ...
}

@amckinney amckinney marked this pull request as ready for review May 21, 2024 15:30
@amckinney amckinney requested a review from dsinghvi as a code owner May 21, 2024 15:30
@amckinney amckinney changed the title (feature, ts): Add wrapFileProperties configuration (feature, ts): Add inlineFileProperties configuration May 21, 2024
Copy link
Member

@dsinghvi dsinghvi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amckinney this looks great

@dsinghvi dsinghvi merged commit 98ff5e4 into main May 21, 2024
26 checks passed
@dsinghvi dsinghvi deleted the amckinney/ts/file branch May 21, 2024 16:04
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.

None yet

2 participants