cloudformation-cli icon indicating copy to clipboard operation
cloudformation-cli copied to clipboard

Duplicate keys not caught by `cfn-cli validate`

Open jarreds opened this issue 3 years ago • 1 comments

We were getting stabilization errors on an AWS::CloudFormation::ResourceVersion of ours. The schema.json passed validation and generated correctly via cfn-cli.

Anyway, here is the diff of the change to our schema.json that fixed the CloudFormation stabilization issue. I'd expect cfn-cli validate to have caught this, but it didn't. As you can see there were two Indexes keys defined in the properties of an object definition.

Screen Shot 2021-05-05 at 11 09 38

jarreds avatar May 05 '21 18:05 jarreds

not surprised CloudFormation doesn't have our own validation for that, but surprised it generated successfully since duplicates keys are not usually valid JSON as far as I know

thanks for raising, will need to look into what library we're parsing JSON with

PatMyron avatar May 07 '21 20:05 PatMyron