-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
sam validate
will accept almost anything, never reports an error
#3836
Comments
@jelder The error printed is actually an printing error on. We attempted to add more validation within the SAM Spec and the output was not meant to be surfaced to CLI users yet as it's not complete. I thought we made changes to this to remove it but maybe that got missed. Will dig in further there.
Will follow up on the error reporting but you can safely ignore that output. |
Valid concern, however with the release of cfn-lint and aws sam cli integration. One can run As of the latest release, sam init should create a default samconfig.toml file, this looks to be a great addition on that front. sam validate --lint
W2001 Parameter WhateverParam not used.
/Users/srirammv/exp/perf-app/tt.yaml:5:3
E2002 Parameter WhateverParam has invalid type whatever
/Users/srirammv/exp/perf-app/tt.yaml:6:5
E3001 Invalid or unsupported Type whatever for resource WhateverResource in us-east-1
/Users/srirammv/exp/perf-app/tt.yaml:10:5
|
As @sriram-mv & @jfuss mentioned, SAM Spec has very basic validation which is mostly done to serverless resources. Resolving this issue but please let us know if you have further questions |
|
sam validate does not point out basic syntax errors. As you can clearly see, this template is missing
But sam validate still does not catch it.
|
Description:
I noticed that
sam validate
will print an error but then report success, including a zero exit code.Steps to reproduce:
Create a
template.yml
full of errors, like this:Observed result:
Expected result:
I would expect that with validation errors,
sam validate
would:template.yml is a valid SAM Template
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.46.0The text was updated successfully, but these errors were encountered: