Closed mdmohan closed 8 months ago
Hi, Thanks for checking. Sure, I'll try the testing part and get back.
Hi, test and changelog added.
Before Fix, with the test:
=== NAME TestCustomNestedObjectValue_renderToObjectValue/map-nested
custom_nested_object_test.go:1447: unexpected difference: bytes.Join({
"\nfunc (v ExampleValue) ToObjectValue(ctx context.Context) (baset",
"ypes.ObjectValue, diag.Diagnostics) {\nvar diags diag.Diagnostics",
"\n\nmapNestedAttribute := types.",
- "List",
+ "Map",
"ValueMust(\nMapNestedAttributeType{\nbasetypes.ObjectType{\nAttrTyp",
"es: MapNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\nv.MapNe",
"stedAttribute.Elements(),\n)\n\nif v.MapNestedAttribute.IsNull() {\n",
"mapNestedAttribute = types.",
- "List",
+ "Map",
"Null(\nMapNestedAttributeType{\nbasetypes.ObjectType{\nAttrTypes: M",
"apNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\n)\n}\n\nif v.Ma",
"pNestedAttribute.IsUnknown() {\nmapNestedAttribute = types.",
- "List",
+ "Map",
"Unknown(\nMapNestedAttributeType{\nbasetypes.ObjectType{\nAttrTypes",
": MapNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\n)\n}\n\n\nobj",
... // 196 identical bytes
}, "")
=== NAME TestCustomNestedObjectValue_renderToObjectValue/set-nested
custom_nested_object_test.go:1447: unexpected difference: bytes.Join({
"\nfunc (v ExampleValue) ToObjectValue(ctx context.Context) (baset",
"ypes.ObjectValue, diag.Diagnostics) {\nvar diags diag.Diagnostics",
"\n\nsetNestedAttribute := types.",
- "Lis",
+ "Se",
"tValueMust(\nSetNestedAttributeType{\nbasetypes.ObjectType{\nAttrTy",
"pes: SetNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\nv.SetN",
"estedAttribute.Elements(),\n)\n\nif v.SetNestedAttribute.IsNull() {",
"\nsetNestedAttribute = types.",
- "Lis",
+ "Se",
"tNull(\nSetNestedAttributeType{\nbasetypes.ObjectType{\nAttrTypes: ",
"SetNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\n)\n}\n\nif v.S",
"etNestedAttribute.IsUnknown() {\nsetNestedAttribute = types.",
- "Lis",
+ "Se",
"tUnknown(\nSetNestedAttributeType{\nbasetypes.ObjectType{\nAttrType",
"s: SetNestedAttributeValue{}.AttributeTypes(ctx),\n},\n},\n)\n}\n\n\nob",
... // 197 identical bytes
}, "")
--- FAIL: TestCustomNestedObjectValue_renderToObjectValue (0.00s)
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Fix for https://github.com/hashicorp/terraform-plugin-codegen-framework/issues/125