question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sam validate always returns Valid!

See original GitHub issue

The tool sam validate is supposed to report errors when a SAM template is not valid.

Currently, it reports anything as valid.

steps to reproduce

cat "{}" > test.json sam validate -t test.json

Expected - Some validation message Actual - Valid!

Affects version

  • snapshot local
  • 0.2.2

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
metaskillscommented, Dec 28, 2017

I made a Ruby script that will read the YAML into JSON and validate against the schema if anyone is interested. https://gist.github.com/metaskills/674d819f24f41ddb9664b0386d147ce0

1reaction
PaulMaddoxcommented, Dec 5, 2017

Currently sam validate just checks whether the template is valid JSON/YAML.

At initial launch, we did do further validation against the SAM specification, however the implementation had a few major bugs and caused a lot of problems for people. As such, we removed this functionality until it can be revisited.

We’ve recently done some work in the goformation to automatically generate a JSON Schema for the whole CloudFormation and SAM specification - which I think we could use within SAM Local to do this more advanced validation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sam validate always returns Valid! · Issue #203 - GitHub
The tool sam validate is supposed to report errors when a SAM template is not valid. Currently, it reports anything as valid.
Read more >
sam validate - AWS Serverless Application Model
Verifies whether an AWS SAM template file is valid.
Read more >
How to check for a valid Base64 encoded string - Stack Overflow
I want to avoid the "Invalid character in a Base-64 string" exception that happens if the value is not valid base 64 string....
Read more >
Tips for SAM.gov Entity Validation Support - GovDelivery
We review these entity validation help tickets in the order they were received. ... Always include the required documentation.
Read more >
A Practical Guide to Surviving AWS SAM Part 1 - Medium
Introduction to AWS SAM for serverless application deployment ... sam validate --template template.yaml ... return json.load(json_file)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found