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

smithy-aws-cloudformation-traits does not mark top-level properties as required #751

Closed
workeitel opened this issue Mar 25, 2021 · 1 comment · Fixed by #937
Closed

smithy-aws-cloudformation-traits does not mark top-level properties as required #751

workeitel opened this issue Mar 25, 2021 · 1 comment · Fixed by #937
Labels
feature-request A feature should be added or improved.

Comments

@workeitel
Copy link

The CloudFormation Resource type schema https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html allows to define properties required. Smithy currently does not mark top-level non-optional properties in the required section:

{
   ...
    "properties": {
         "propertyName": {
            "description": "string",
            "type": "string",
             . . . 
        },
 
        },
    },
    "required": [   // not added in Smithy
        "propertyName"
    ],
   ...
@kstich
Copy link
Contributor

kstich commented Apr 5, 2021

Looks like we'll need to add support for determining this field and the new conditionalCreateOnlyProperties field.

For now, you can set these properties directly with the jsonAdd configuration setting:

"jsonAdd": {
    "smithy.example#Queue": {
        "/required": [
            "propertyName"
        ]
    }
}

@JordonPhillips JordonPhillips added the feature-request A feature should be added or improved. label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants