-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tfsdk: Prevent configuration handling error when Schema contains Blocks #371
Conversation
Reference: #328 Previously the framework could return errors similar to the following: ``` Error: Error parsing config The provider had a problem parsing the config. Report this to the provider developer: AttributeName("output").ElementKeyInt(0): error decoding object; expected 0 attributes, got 5 ``` New unit testing failures before fix: ``` --- FAIL: TestBlockAttributeType (0.00s) --- FAIL: TestBlockAttributeType/NestingMode-Set (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/tfsdk/block_test.go:103: unexpected difference: types.SetType( - s`types.SetType[types.ObjectType["test_attribute":types.StringType]]`, + s`types.SetType[types.ObjectType["test_attribute":types.StringType, "test_block":types.SetType[types.ObjectType["test_block_attribute":types.StringType]]]]`, ) --- FAIL: TestBlockAttributeType/NestingMode-List (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/tfsdk/block_test.go:103: unexpected difference: types.ListType( - s`types.ListType[types.ObjectType["test_attribute":types.StringType]]`, + s`types.ListType[types.ObjectType["test_attribute":types.StringType, "test_block":types.ListType[types.ObjectType["test_block_attribute":types.StringType]]]]`, ) --- FAIL: TestBlockTerraformType (0.00s) --- FAIL: TestBlockTerraformType/NestingMode-List (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/tfsdk/block_test.go:199: unexpected difference: tftypes.List( - s`tftypes.List[tftypes.Object["test_attribute":tftypes.String]]`, + s`tftypes.List[tftypes.Object["test_attribute":tftypes.String, "test_block":tftypes.List[tftypes.Object["test_block_attribute":tftypes.String]]]]`, ) --- FAIL: TestBlockTerraformType/NestingMode-Set (0.00s) /Users/bflad/src/github.com/hashicorp/terraform-plugin-framework/tfsdk/block_test.go:199: unexpected difference: tftypes.Set( - s`tftypes.Set[tftypes.Object["test_attribute":tftypes.String]]`, + s`tftypes.Set[tftypes.Object["test_attribute":tftypes.String, "test_block":tftypes.Set[tftypes.Object["test_block_attribute":tftypes.String]]]]`, ) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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. |
Closes #328
Previously the framework could return errors similar to the following:
New unit testing failures before fix: