Skip to content

PlanModifiers on Custom Type NestedAttributeObject/NestedBlockObject #767

@bflad

Description

@bflad

Module version

v1.3.0

Relevant provider source code

(Pending confirmation) The following provider code could be problematic with the framework's attribute-based plan modification logic:

schema.ListNestedAttribute{
  // ... other fields ...
  NestedObject: schema.NestedAttributeObject{
    // ... other fields ...
    CustomType: /* basetypes.ObjectTypable */,
    PlanModifiers: []planmodifier.Object{/* a plan modifier that returns basetypes.ObjectValue */},
  }
}

Expected Behavior

The framework should roundtrip custom value type implementations through the plan modification logic.

Actual Behavior

The basetypes.ObjectValue returned from a plan modifier is preserved. This likely will generate a Value Conversion Error diagnostic from the framework or some other confusing behavior.

Fixing this issue will require some hefty internal code refactoring, so opting to split this effort from #754.

Steps to Reproduce

Should be reproducible with additional unit test cases in internal/fwserver/attribute_plan_modification_test.go / internal/fwserver/block_plan_modification_test.go and running go test.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions