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

Consider Allowing Usage of Custom Types for Structural Elements #509

Closed
wants to merge 4 commits into from

Conversation

bendbennett
Copy link
Contributor

@bendbennett bendbennett commented Oct 7, 2022

Closes: #508

So far (2022-10-07) this draft PR only addresses allowing optionally specifying the type on a block. Further changes will be required for equivalent functionality with nested attributes.

object, ok := value.(types.Object)
// coerceObjectValue no longer coerces value to types.Object, but performs a type assertion to verify that value fills
// attr.ValueWithAttrs interface.
func coerceObjectValue(schemaPath path.Path, value attr.Value) (attr.Value, diag.Diagnostics) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function signature could be altered to return attr.ValueWithAttrs so that type assertions are not required elsewhere.

Function name should also change to something like coerceValueWithAttrs.

@bendbennett bendbennett added the enhancement New feature or request label Oct 7, 2022
@bendbennett
Copy link
Contributor Author

Closed by #553, #558, #546

@bendbennett bendbennett deleted the bendbennett/issues-508 branch November 30, 2022 14:50
@github-actions
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 Dec 31, 2022
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 Allowing Usage of Custom Types for Structural Elements
1 participant