Skip to content

New Checks: XS003: Check Schema for potential panic/diff#236

Open
magodo wants to merge 6 commits intobflad:mainfrom
magodo:XS003
Open

New Checks: XS003: Check Schema for potential panic/diff#236
magodo wants to merge 6 commits intobflad:mainfrom
magodo:XS003

Conversation

@magodo
Copy link
Contributor

@magodo magodo commented Apr 22, 2021

The XS003 analyzer reports cases of schemas where a non-computed nested block property of TypeList contains optional-only and non-default child properties, which has no AtLeastOneOf/ExactlyOneOf constraint.

This kind of schema causes panic like in hashicorp/terraform-provider-azurerm#11426 (and more). Also, if we work this kind of issue around during expanding, an empty block will still cause noising plan diff. A good solution is to add the constraint in schema.

This check has help AzureRM provider codebase to detect ~100 schemas that have panic risk (hashicorp/terraform-provider-azurerm#11452).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant