Skip to content
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 JSON schema #1133

Closed
jlhood opened this issue Sep 8, 2019 · 8 comments
Closed

SAM JSON schema #1133

jlhood opened this issue Sep 8, 2019 · 8 comments
Assignees
Labels
area/json-schema area/validation Syntactic and Semantic validation done by SAM type/feature

Comments

@jlhood
Copy link
Contributor

jlhood commented Sep 8, 2019

Description:

Today, SAM's spec is a document meant for human consumption only. SAM should also have an authoritative, machine-readable spec (schema). This would be beneficial in multiple ways:

  1. This would allow cfn-lint to remove its dependency on the SAM translator code, which can cause dependency conflicts with other modules if they depend on a different version of SAM translator. cfn-lint could keep a copy the SAM schema similar to what it does for CloudFormation schemas. Then there would no longer be a dependency conflict.
    1. Somewhat tangential: I'd prefer for SAM CLI's sam validate command to just run cfn-lint against the template. I think this would be far more valuable than what the current sam validate command offers. Removing cfn-lint's dependency on SAM translator would unblock this.
  2. If we could embed the documentation of the current spec into the schema, this could lead to the human-readable version of the spec being auto-generated. This would allow us to auto-generate the SAM spec in the official SAM documentation after each SAM release.
@kddejong
Copy link
Contributor

kddejong commented Sep 9, 2019

From a cfn lint perspective I like this idea. sam translator is currently essential to us being able to lint serverless templates. Having a shema could remove us from that requirement and allow us to directly lint the original file.

@keetonian keetonian added area/validation Syntactic and Semantic validation done by SAM type/feature labels Sep 10, 2019
@nija-at
Copy link

nija-at commented Sep 27, 2019

+1 to this.

AWS CDK is currently using the spec for awslabs/goformation to auto-generate CDK L1 resources (i.e. language bindings) and we're seeing a couple of cases where the handcrafted spec deviates from SAM's spec, specifically in terms of required and optional attributes, that blocks our customers from doing the right thing.

Referencing aws/aws-cdk#3841 and awslabs/goformation#87.

@stilvoid
Copy link

Another +1. I'd like to add SAM resource types to https://github.com/aws-cloudformation/rain :)

@tj
Copy link

tj commented Sep 17, 2020

There's https://github.com/aws/serverless-application-model/blob/develop/samtranslator/validator/sam_schema/schema.json , but it doesn't seem up-to-date, it's missing HttpApi, I'd like to have something as well though!

@jfuss
Copy link
Contributor

jfuss commented Mar 1, 2022

Pining to clear the maintainer/need-response label. The team is looking at a better validation experience through jsonschema but none of that work is in progress or fully designed.

We did some work on this already: #2195 and #2032

@hoffa hoffa changed the title Create machine-readable SAM spec JSON schema Nov 17, 2022
@hoffa hoffa removed type/docs stage/pm-review Waiting for review by our Product Manager, please don't work on this yet labels Nov 17, 2022
@hoffa hoffa self-assigned this Nov 17, 2022
@hoffa hoffa mentioned this issue Nov 17, 2022
@hoffa hoffa added area/validation Syntactic and Semantic validation done by SAM and removed area/validation Syntactic and Semantic validation done by SAM labels Nov 17, 2022
@hoffa
Copy link
Contributor

hoffa commented Nov 22, 2022

Relevant: #2645

@hoffa
Copy link
Contributor

hoffa commented Nov 24, 2022

@hoffa hoffa closed this as completed Nov 24, 2022
@hoffa hoffa unpinned this issue Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/json-schema area/validation Syntactic and Semantic validation done by SAM type/feature
Projects
None yet
Development

No branches or pull requests