cloudformation-resource-schema icon indicating copy to clipboard operation
cloudformation-resource-schema copied to clipboard

Validate examples of properties in schema according to schema

Open tobywf opened this issue 4 years ago • 1 comments

From https://github.com/aws-cloudformation/aws-cloudformation-rpdk/issues/68

At the moment, examples fields aren't validated. The result is invalid examples, e.g. this ARN (rouge dot at the end):

"Arn": {
    "type": "string",
    "pattern": "^arn:aws(-(cn|gov))?:[a-z-]+:(([a-z]+-)+[0-9])?:([0-9]{12})?:[^.]+$"
    "examples": [
        "arn:aws:sqs:us-east-2:123456789012:mystack-myqueue-15PG5C2FC1CW8."
    ]
},

It's a shame JSON schema doesn't do this, but we can add this.

tobywf avatar Jul 08 '19 21:07 tobywf

It's a shame JSON schema doesn't do this

Agreed. This should probably be upstreamed if we get around to fixing this

PatMyron avatar Aug 31 '20 22:08 PatMyron