-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Models Validation doesn't check the implicitly created AWS::Serverless::Api resource #2209
Comments
Thanks for reporting this in! Please allow us some time to investigate the feasibility of the request! Again thanks for the input! |
Facing the same issue |
Facing Same Issue, Any update on above request. |
Marking this as |
I took a deep dive into this problem. Unfortunately I believe this is expected behaviour and we've clearly documented this behaviour here. The workaround would have to define an explicit |
Description:
The Models Validation doesn't check the implicitly created
AWS::Serverless::Api
resource. When creating a new model there's no way to set it to the implicitlyAWS::Serverless::Api resource
withoutsam validate
failing. Models isn't a valid global parameter so it can't be set there. Creating a AWS::ApiGateway::Model resource setting RestApiId toServerlessRestApi
the following validation error is thrown...the related API does not define any Models
. This means the only way to add a Model is to explicitly create the Api resource, add the Models to it, and then set RestApiId on the other resources. This is a pain point for us because we have 75 Function resources in the template that now need to explicitly set RestApiId.Steps to reproduce:
Observed result:
Error: [InvalidResourceException('CreateAccountFunction', 'Event with id [CreateAccount] is invalid. Unable to set RequestModel [CreateAccountsModel] on API method [post] for path [/accounts] because the related API does not define any Models.')] ('CreateAccountFunction', 'Event with id [CreateAccount] is invalid. Unable to set RequestModel [CreateAccountsModel] on API method [post] for path [/accounts] because the related API does not define any Models.')
Expected result:
I would expect the validation to check if any models exist on the implicitly created Api resource.
The text was updated successfully, but these errors were encountered: