Critical: Fixed JSON parsing crash with Azure resources (v1.16.2)
This patch release fixes a critical crash introduced in v1.16.0/v1.16.1 that affected users processing Terraform plans with certain Azure resources.
🐛 Bug fixes
-
Fixed crash with Object-typed references in Azure resources (Issue #71) - v1.16.0 and v1.16.1 would crash with
JsonElementHasWrongType, Object, Arraywhen processing Terraform plans containing Azure Storage containers, role assignments, or other resources where the configuration'sreferencesfield was structured as an Object instead of an Array. The tool now handles both Array and Object structures gracefully. -
Fixed crash with Array-typed expression properties (Issue #464) - This is a second instance of the
JsonElementHasWrongTypeerror. While Issue #71 fixed the case where thereferencesproperty had the wrong type (Object instead of Array), this fix addresses a different scenario: when expression property values themselves are Arrays representing nested Terraform blocks. For example,azurerm_data_factory_trigger_scheduleresources can have nestedpipelineblocks that appear as Array-valued expression properties likeauthentication_credentials: [{ credential_id: "test" }]. The code must checkValueKindBEFORE callingTryGetPropertyto prevent crashes when processing such configurations.
Impact: Users of v1.16.0 or v1.16.1 who process plans with:
- Azure Storage containers, role assignments (Issue #71)
- Azure Data Factory resources with nested blocks (Issue #464)
- Any other resources with non-standard JSON structures in their configuration
should upgrade immediately.
Technical details: The new configuration reference resolver (introduced in v1.16.0) attempted to enumerate JSON array elements without properly validating the ValueKind in all code paths. This release adds explicit defensive checks before calling .EnumerateArray() in both ConfigurationReferenceResolver and ReportModelBuilder.ParentChildMerging. Additionally, it adds checks before calling .TryGetProperty() on expression property values to handle Array-typed nested blocks.
🔗 Commits
Issue #71 (Object-typed references)
fd04c22test: add edge case tests for JSON parsing with non-array typesc08eac4fix: enhance defensive checks for JSON array enumeration
Issue #464 (Array-typed expression properties)
b8b17fdfix: handle array-typed expression properties in ConfigurationReferenceResolveraacbe2bdocs: add code review for JsonElementHasWrongType bug fix122affcchore: push Code Reviewer's commit (review approved)002352dchore: push Release Manager's commits (release notes ready)
📋 Analysis & Review
- Root cause analysis: docs/issues/071-json-parsing-error-azurerm-resources/analysis.md
- Code review: docs/issues/071-json-parsing-error-azurerm-resources/code-review.md
- Test coverage:
- All tests: Passing (full test suite verified)