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

schema/validator: New type-specifc validators package #542

Merged
merged 2 commits into from Nov 17, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Nov 16, 2022

Closes #83 (we should explicitly create individual Describer interfaces per concept, if desired)
Reference: #132

As part of upcoming effort to split schema functionality into the datasource, provider, and resource packages, there are some improvements that will land in the new implementations rather than breaking the existing tfsdk package schema functionality.

One area which has caused developer burden is that "attribute" validators, currently implementations of the tfsdk.AttributeValidator interface, receive a generic attr.Value as the configuration value to perform validation logic. This means that implementors must currently handle validating and converting the value into the concrete type they expect.

The upcoming split schemas handling will introduce separate attribute/block types that will enable to framework to strongly type validators and other future schema enhancements. This change prepares the exported interfaces and internal validation logic for those enhancements.

Reference: #83
Reference: #132

As part of upcoming effort to split schema functionality into the `datasource`, `provider`, and `resource` packages, there are some improvements that will land in the new implementations rather than breaking the existing `tfsdk` package schema functionality.

One area which has caused developer burden is that "attribute" validators, currently implementations of the `tfsdk.AttributeValidator` interface,  receive a generic `attr.Value` as the configuration value to perform validation logic. This means that implementors must currently handle validating and converting the value into the concrete type they expect.

The upcoming split schemas handling will introduce separate attribute/block types that will enable to framework to strongly type validators and other future schema enhancements. This change prepares the exported interfaces and internal validation logic for those enhancements.
@bflad bflad added the enhancement New feature or request label Nov 16, 2022
@bflad bflad requested a review from a team as a code owner November 16, 2022 19:20
@bflad bflad added this to the v0.17.0 milestone Nov 16, 2022
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

Awesome. LGTM

@bflad bflad merged commit b89b71a into main Nov 17, 2022
@bflad bflad deleted the bflad/schema-validator-package branch November 17, 2022 15:02
@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 18, 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.

Create a Describer interface
2 participants