-
Notifications
You must be signed in to change notification settings - Fork 618
chore: add updated RDS DATA smithy model #370
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
Conversation
header default middleware expect continue middleare
Well, I have to update all middlewares to pass the CI |
f4f36c7
to
9c20ebc
Compare
The shapes are failing in a few places:
|
Fixed in generator
Fixed in generator |
Just updated the PR with newest model. The |
6f7f964
to
96bb132
Compare
* smithy-typescript: ddd6257c956381a8a16fe224d3a9de8286e7ed5f * smithy: 17df2312a0fd9bde2e4c5c0c61c5602cd20bc27f
): ExecuteStatementResponse { | ||
let data: any = {}; | ||
if (output.body) { | ||
data = JSON.parse(output.body); |
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.
Here the output.body
is not a binary data. It's actually Readable
in node and Blob
in browser. You should call streamcollector transfer them into binary. Example can be found here:
aws-sdk-js-v3/packages/protocol-rest/src/RestParser.ts
Lines 215 to 234 in 226e544
private resolveBody( | |
body: HttpResponse<StreamType>["body"] = "" | |
): Promise<Uint8Array | string> { | |
if (typeof body === "string") { | |
return Promise.resolve(body); | |
} | |
let bufferPromise: Promise<Uint8Array>; | |
if (ArrayBuffer.isView(body)) { | |
bufferPromise = Promise.resolve( | |
new Uint8Array(body.buffer, body.byteOffset, body.byteLength) | |
); | |
} else if (isArrayBuffer(body)) { | |
bufferPromise = Promise.resolve(new Uint8Array(body, 0, body.byteLength)); | |
} else { | |
bufferPromise = this.bodyCollector(body); | |
} | |
return bufferPromise; | |
} |
}); | ||
} | ||
|
||
export function executeStatementAwsRestJson1_1Deserialize( |
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.
Deserializers should be async functions that return a promise according to our definition
…Fly120/aws-sdk-js-v3 into zheallan-smithy-codegen
8081286
to
c60241b
Compare
Codecov Report
@@ Coverage Diff @@
## smithy-codegen #370 +/- ##
=================================================
Coverage ? 97.28%
=================================================
Files ? 69
Lines ? 1177
Branches ? 215
=================================================
Hits ? 1145
Misses ? 32
Partials ? 0
Continue to review full report at Codecov.
|
The (de)serializer looks good to me. 🚢 |
@@ -0,0 +1,44 @@ | |||
export const TYPE = "__type"; |
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 think we could move this file into a shared package in the future. This is fine for now.
@@ -68,6 +69,6 @@ | |||
"rollup-plugin-replace": "^2.2.0", | |||
"rollup-plugin-sourcemaps": "^0.4.2", | |||
"typedoc": "^0.14.2", | |||
"typescript": "~3.4.0" | |||
"typescript": "^3.7.0-dev.20190926" |
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.
Probably shouldn't rely on a dev build
export function executeStatementAwsRestJson1_1Serialize( | ||
input: ExecuteStatementRequest | ||
): HttpRequest { | ||
let body: any = {}; |
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.
A performance improvement here would be to use a streaming JSON serializer rather than needing to store the JSON object in an intermediate value. This should be done at some point but isn't a blocker right now.
}); | ||
} | ||
|
||
function executeStatementAwsRestJson1_1DeserializeError( |
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 think this needs work. It should check the x-amzn-ErrorType header for the ID of the error and use that. If that's not found, then it should fall back to status codes.
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. |
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.