-
Hey there Does SAM templates support method responses at this time? |
Beta Was this translation helpful? Give feedback.
Replies: 2 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.
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::Deployment
is a generated resource, there is no simple way to addDependsOn
on this generated resource.That means there is currently no way to explicitly define a
AWS::ApiGateway::Method
with 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…