-
Notifications
You must be signed in to change notification settings - Fork 391
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
Make reflect_resource and customizable_schema work for data source #3880
base: terraform-plugin-framework
Are you sure you want to change the base?
Make reflect_resource and customizable_schema work for data source #3880
Conversation
"github.com/hashicorp/terraform-plugin-framework/resource/schema" | ||
"github.com/hashicorp/terraform-plugin-framework/schema/validator" | ||
) | ||
|
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.
type Validator interface {
Whatever()
}
type ResourceValidator struct{
validator schema.Validator
}
func (ResourceValidator) Whatever() {}
type DataSourceValidator struct {
validator dataschema.Validator
}
AddValidators(Validator) Attribute
field.Set(newSlice) | ||
|
||
return val.Interface().(schema.Attribute) | ||
cb := func(attr Attribute) Attribute { |
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.
Idea: expose type-specific methods here instead of any
?
return a | ||
} | ||
|
||
type MapAttribute struct { |
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.
For this type and the ones below, doccomments
## Changes <!-- Summary of your changes that are easy to understand --> - Addressing comments from #3880 - Adding AttributeBuilder - the common interface for building data source schema and resource schema - Adding customisation functions for each type of attribute ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [x] relevant change in `docs/` folder - [x] covered with integration tests in `internal/acceptance` - [x] relevant acceptance tests are passing - [x] using Go SDK
## Changes <!-- Summary of your changes that are easy to understand --> - Addressed comments in #3880 - Add CustomizableSchema for PluginFramework ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [x] relevant change in `docs/` folder - [x] covered with integration tests in `internal/acceptance` - [x] relevant acceptance tests are passing - [x] using Go SDK
Changes
Tests
make test
run locallydocs/
folderinternal/acceptance