Running --stateful check on schema change, I have a situation where a property is going from accepting only type object to accepting type object or string. This seems like it should be considered backwards-compatible, but guard-rail is currently flagging it as a type change.
Repro steps:
- Pull current IAM Role schema:
aws cloudformation describe-type --type RESOURCE --type-name AWS::IAM::Role | jq -r .Schema > iam-role-schema.json
cp iam-role-schema.json iam-role-schema-modified.json
- Manually modify
iam-role-schema-modified.json so PolicyDocument property has "type": "object".
- Run
guard-rail --schema file:///path/to/iam-role-schema-modified.json --schema file:///path/to/iam-role-schema.json --stateful --format
Expected result
- Schema passes stateful checks.
- Actual result:
[FAILED]:
ENSURE_PROPERTY_TYPE_NOT_CHANGED:
check-id: TP003
message: cannot change TYPE of a property
Running
--statefulcheck on schema change, I have a situation where a property is going from accepting only type object to accepting type object or string. This seems like it should be considered backwards-compatible, but guard-rail is currently flagging it as a type change.Repro steps:
aws cloudformation describe-type --type RESOURCE --type-name AWS::IAM::Role | jq -r .Schema > iam-role-schema.jsoncp iam-role-schema.json iam-role-schema-modified.jsoniam-role-schema-modified.jsonsoPolicyDocumentproperty has"type": "object".guard-rail --schema file:///path/to/iam-role-schema-modified.json --schema file:///path/to/iam-role-schema.json --stateful --formatExpected result