Open jesusaurus opened 1 year ago
Thanks for reporting this issue @jesusaurus.
This is a tricky one since you can use AWS::ServerlessRepo::Application
with an app which was already published, for that case Metadata
would not be required. See docs here; https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-application.html#sam-application-location
But we can still add some validation to sam validate
if users defines a local path for that property. I will tag this issue as feature and let our PMs know about it.
Description:
A template with no
AWS::ServerlessRepo::Application
Metadata is not a valid template, and will not publish duringsam publish
, butsam validate
will report that the template is valid.Steps to reproduce:
Remove or rename
AWS::ServerlessRepo::Application
in the template and runsam validate
andsam publish
.Observed result:
Success during
sam validate
, failure duringsam publish
.Expected result:
An error message and a non-zero exit code during
sam validate
.Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: 1.53.0