mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-20 12:02:01 -04:00
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:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user