Skip to content

Commit

Permalink
Survive incorrect deprecatedProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr committed Oct 31, 2023
1 parent adc1a80 commit d4fe12f
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export function importCloudFormationRegistryResource(options: LoadCloudFormation

recurseProperties(resource, resourceBuilder, resourceFailure);

resourceBuilder.markDeprecatedProperties(...(resource.deprecatedProperties ?? []).map(simplePropNameFromJsonPtr));
// AWS::CloudFront::ContinuousDeploymentPolicy recently introduced a change where they're marking deprecatedProperties
// as `/definitions/<Type>/properties/<Prop>` instead of `/properties/<Prop1>/<Prop2>/<Prop3>`. Ignore those, as it's
// out-of-spec
const deprecatedProperties = (resource.deprecatedProperties ?? []).filter((p) => p.startsWith('/properties/'));
resourceBuilder.markDeprecatedProperties(...deprecatedProperties);

// Mark everything 'readOnlyProperties` as attributes. However, in the old spec it is possible
// that properties and attributes have the same names, with different types. If that happens (by
Expand Down

0 comments on commit d4fe12f

Please sign in to comment.