-
|
Hey there Does SAM templates support method responses at this time? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
I would rather have a way to define the response model directly at AWS::Serverless::Function level, similar to what we have now for request model https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-property-function-requestmodel.html |
Beta Was this translation helpful? Give feedback.
-
|
Any new here? With the feature of adding Amazon API Gateway REST API stages as targets for the Bedrock AgentCore Gateway method response codes becomes required as internally AgentCore Gateway calls the GetExport operation for API Gateway on our behalf to get an OpenAPI 3.0 formatted export of the API definition. It fails (among others) without at least one method response code defined. So it became a bit challenging to use the pure AWS SAM for such use cases with out defining Open API specification as shown above. |
Beta Was this translation helpful? Give feedback.

An update to my response. The above answer is incorrect. I noticed that when I deploy this template using
sam deploy --guided, it would fail becauseResource handler returned message: "No integration defined for method.After some investigation, this is expected behaviour according to this documentation. Unfortunately, because
AWS::ApiGateway::Deploymentis a generated resource, there is no simple way to addDependsOnon this generated resource.That means there is currently no way to explicitly define a
AWS::ApiGateway::Methodwith a SAM API resource. Will bring this issue up to team discussion.Currently, the only solution is to define your custom OpenAPI definition files or use inlin…