-
Notifications
You must be signed in to change notification settings - Fork 92
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
widen blob payload input types, add blob payload output converter #777
Conversation
c50b9cb
to
0178742
Compare
14bb492
to
a909bc5
Compare
...typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java
Outdated
Show resolved
Hide resolved
...typescript-codegen/src/main/java/software/amazon/smithy/typescript/codegen/CodegenUtils.java
Outdated
Show resolved
Hide resolved
@@ -248,25 +248,14 @@ static void generateMetadataDeserializer(GenerationContext context, SymbolRefere | |||
} | |||
|
|||
/** | |||
* Writes a response body stream collector. This function converts the low-level response body stream to | |||
* Imports a response body stream collector. This function converts the low-level response body stream to | |||
* Uint8Array binary data. | |||
* | |||
* @param context The generation context. | |||
*/ | |||
static void generateCollectBody(GenerationContext context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this whole method if it just imports something? Or maybe change the name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rolled it into the generateCollectBodyString method, which is called in all places that generateCollectBody was called.
e1e48c4
to
ca724d4
Compare
aws/aws-sdk-js-v3#4786
aws/aws-sdk-js-v3#4265
Blob types enhancements
Uint8Array
toBlobTypes
, which contains common and runtime specific types.Uint8ArrayBlobAdapter
, which extends theUint8Array
native class and adds a convenient platform-specific way to convert to string. Example in the linked JSv3 PR feat(clients): automatic blob type conversions aws/aws-sdk-js-v3#4836.This applies in general, but the user story is difficulty/inconvenience around non-streaming blob i/o, e.g. in Lambda invoke. Non-streaming blobs were treated uniformly as Uint8Array in input and output, but this does not cover the realistic use cases of payload blobs.