-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(type-safe-api): include error header expected by smithy generate…
…d client in handler wrappers (#468) Clients generated directly from Smithy (using the typescript-codegen plugin) can deserialise error responses into the appropriate generated model classes, but they do this by checking for a special `x-amzn-errortype` header. This change updates the generated handler wrappers to include the appropriate value for this header for error responses. Note that OpenAPI specs generated from Smithy add "ResponseContent" as a suffix to all response data types, so we remove this in order to match the appropriate error structure ID. If the response data type doesn't end with ResponseContent, it didn't come from Smithy so there's no need to return this header anyway. re #460
- Loading branch information
Showing
6 changed files
with
234 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/type-safe-api/test/scripts/generators/__snapshots__/java.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 24 additions & 11 deletions
35
packages/type-safe-api/test/scripts/generators/__snapshots__/python.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.