Skip to content
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

tfprotov5+tfprotov6: Introduce ValueType() methods for Schema types #158

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Feb 16, 2022

Reference: #128
Closes #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).

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 bflad added the enhancement New feature or request label Feb 16, 2022
@bflad bflad requested a review from a team as a code owner February 16, 2022 19:54
@bflad
Copy link
Contributor Author

bflad commented Feb 17, 2022

/cc @alexsomesan you may find these useful for replacing some manifest provider logic 👍

@bflad bflad added this to the v0.8.0 milestone Feb 17, 2022
@bflad bflad merged commit 6f912e5 into main Feb 17, 2022
@bflad bflad deleted the bflad-schema-type-methods branch February 17, 2022 18:06
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider Adding tfprotov5/tfprotov6 Schema* Methods for tftypes.Type Conversion
2 participants