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

create a type alias for http payloads #4933

Closed
1 of 2 tasks
kuhe opened this issue Jul 6, 2023 · 5 comments · Fixed by #4987 or smithy-lang/smithy-typescript#835
Closed
1 of 2 tasks

create a type alias for http payloads #4933

kuhe opened this issue Jul 6, 2023 · 5 comments · Fixed by #4987 or smithy-lang/smithy-typescript#835
Assignees
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue queued This issues is on the AWS team's backlog

Comments

@kuhe
Copy link
Contributor

kuhe commented Jul 6, 2023

Describe the feature

Currently payloads' runtime-acceptable type depends on the request handler implementation. To allow for multiple possible implementations we have a wide http payload type, e.g.

string | Blob | Uint8Array | Readable | ReadableStream<any> | Buffer | undefined

for PutObjectCommandInput.Body.

This is confusing for users, and more-so now that Node.js has made many previously browser-only types available.

Use Case

improve documentation ease of use for http payload types

Proposed Solution

Create a type alias for the union of blob types.

The type alias will have attached documentation describing when each of the union types is acceptable or preferred.

Similar to: https://github.com/aws/aws-sdk-js-v3/blob/main/packages/types/src/blob/blob-types.ts

/**

Write docs here explaining what types are available in what environments (corresponding to request handlers).
 
*/
export type StreamingPayloadTypes = string | Blob | Uint8Array | Readable | ReadableStream<any> | Buffer

Codegen the alias to operations with streaming body inputs so that the documentation is easy to access.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

Environment details (OS name and version, etc.)

@kuhe kuhe added feature-request New feature or enhancement. May require GitHub community feedback. needs-triage This issue or PR still needs to be triaged. labels Jul 6, 2023
@kuhe
Copy link
Contributor Author

kuhe commented Jul 6, 2023

Related: #4930

@kuhe kuhe added p2 This is a standard priority issue queued This issues is on the AWS team's backlog and removed needs-triage This issue or PR still needs to be triaged. labels Jul 6, 2023
@kuhe kuhe self-assigned this Jul 17, 2023
@kuhe
Copy link
Contributor Author

kuhe commented Jul 17, 2023

related #4973

@kuhe
Copy link
Contributor Author

kuhe commented Jul 17, 2023

related request to allow transformation to node stream: #4720

@kuhe
Copy link
Contributor Author

kuhe commented Jul 17, 2023

@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request New feature or enhancement. May require GitHub community feedback. p2 This is a standard priority issue queued This issues is on the AWS team's backlog
Projects
None yet
1 participant