-
Notifications
You must be signed in to change notification settings - Fork 33
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
Consider Adding tfprotov5/tfprotov6 Schema* Methods for tftypes.Type Conversion #157
Labels
enhancement
New feature or request
Comments
bflad
added a commit
that referenced
this issue
Feb 16, 2022
Reference: #128 Reference: #157 This methods implement standard conversion logic from `Schema*` types into their associated `tftypes.Type` equivalent. For example, these can be used to prepare calls to the `(DynamicValue).Unmarshal()` method, which is necessary in many RPCs. Preferably, these methods would have been named `Type()`, however the `SchemaAttribute` type implements a `Type` field and Go does not permit overlapping field and method names. Instead, the name `ValueType()` was chosen as an alternate designation as the `tftypes.Type` really represents a data value type, instead of a type constraint (sometimes also referred to as a schema type).
bflad
added a commit
that referenced
this issue
Feb 17, 2022
…158) Reference: #128 Reference: #157 This methods implement standard conversion logic from `Schema*` types into their associated `tftypes.Type` equivalent. For example, these can be used to prepare calls to the `(DynamicValue).Unmarshal()` method, which is necessary in many RPCs. Preferably, these methods would have been named `Type()`, however the `SchemaAttribute` type implements a `Type` field and Go does not permit overlapping field and method names. Instead, the name `ValueType()` was chosen as an alternate designation as the `tftypes.Type` really represents a data value type, instead of a type constraint (sometimes also referred to as a schema type).
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
terraform-plugin-go version
Use cases
Downstream implementations, whether SDKs or providers, may need to retrieve the
tftypes.Type
equivalent oftfprotov5
/tfprotov6
schema types such as:Schema
SchemaAttribute
SchemaBlock
SchemaNestedBlock
SchemaObject
For example, this is necessary for calling
(DynamicValue).Unmarshal()
, which is necessary for data handling ofApplyResourceChange
and other RPCs.Attempted solutions
Manually (re-)implementing this logic downstream.
Proposal
Implement methods such as the following:
With associated unit testing.
References
The text was updated successfully, but these errors were encountered: