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

feat(type-safe-api): include error header expected by smithy generated client in handler wrappers #468

Merged
merged 1 commit into from
Jun 13, 2023

Commits on Jun 13, 2023

  1. feat(type-safe-api): include error header expected by smithy generate…

    …d client in handler wrappers
    
    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
    cogwirrel committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    43051c3 View commit details
    Browse the repository at this point in the history