You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add gatewayResponses trait and OpenAPI mapper (smithy-lang#3089)
* Add gatewayResponses trait and OpenAPI mapper
API Gateway REST APIs support custom gateway responses that
customize error responses for authentication failures, integration
errors, and other API Gateway-generated errors.
Add the `aws.apigateway#gatewayResponses` map trait that maps
response type keys to gateway response structures containing
statusCode, responseParameters, and responseTemplates. The OpenAPI
mapper writes the trait value to the
`x-amazon-apigateway-gateway-responses` extension. The mapper runs
before the CORS gateway responses mapper so that customer-defined
response parameters take precedence over CORS-generated headers.
* Refactor GatewayResponsesTrait to use builder pattern
Add GatewayResponse value class with builder following the same
pattern as AuthorizersTrait and DefineConditionKeysTrait. Add
DANGER validator for gatewayResponses and CORS conflicts. Fix
RST header formatting in documentation.
* Update smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddGatewayResponses.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
* Replace streams with loops and add bulk builder methods
Replace stream-based serialization with plain loops in
GatewayResponse.toNode() and GatewayResponsesTrait.createNode().
Add responses(), responseParameters(), and responseTemplates()
bulk setter methods to the builders.
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponse.java
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponse.java
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
* Update smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddGatewayResponses.java
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
* Update smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/GatewayResponsesTrait.java
---------
Co-authored-by: Manuel Sugawara <sugmanue@amazon.com>
.. _Granting Permissions Using a Resource Policy: https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#intro-permission-model-access-policy
0 commit comments