Add support for maps in the structured renderer (#32397)

* prep for processing the structured run output

* undo unwanted change to a json key

* Add skeleton functions and API for refactored renderer

* goimports

* Fix documentation of the RenderOpts struct

* Add rendering functionality for primitives to the structured renderer

* add test case for override

* Add support for parsing and rendering sensitive values in the renderer

* Add support for unknown/computed values in the structured renderer

* delete missing unit tests

* Add support for object attributes in the structured renderer

* goimports

* Add support for the replace paths data in the structured renderer

* Add support for maps in the structured renderer
This commit is contained in:
Liam Cervante
2023-01-09 12:41:24 +01:00
committed by GitHub
parent b097d8873d
commit 8975eebf84
8 changed files with 751 additions and 95 deletions

View File

@@ -19,6 +19,8 @@ func (v Value) computeChangeForNestedAttribute(attribute *jsonprovider.NestedTyp
switch attribute.NestingMode {
case "single", "group":
return v.computeAttributeChangeAsNestedObject(attribute.Attributes)
case "map":
return v.computeAttributeChangeAsNestedMap(attribute.Attributes)
default:
panic("unrecognized nesting mode: " + attribute.NestingMode)
}
@@ -30,6 +32,8 @@ func (v Value) computeChangeForType(ctyType cty.Type) change.Change {
return v.computeAttributeChangeAsPrimitive(ctyType)
case ctyType.IsObjectType():
return v.computeAttributeChangeAsObject(ctyType.AttributeTypes())
case ctyType.IsMapType():
return v.computeAttributeChangeAsMap(ctyType.ElementType())
default:
panic("not implemented")
}