Open SarahFrench opened 1 month ago
Note to add: This suggested change is still relevant after the 'muxing fix' changes I am in the process of getting accepted and merged because even when the SDK and PF providers share the same meta the SDK and PF providers will have separate schemas. Validation placed on the PF schema that can detect and reject empty strings benefits the 'whole' provider, regardless of whether a user's config is provisioning anything implemented with the PF.
Labelled as plugin-framework
because this would be achieved by adding a Validator on the PF provider's schema, similar to this:
Community Note
Description
Currently the Google provider offers validation feedback to users when they set some provider-level string fields as empty strings. In the past empty strings would be silently ignored, because the SDK treats empty strings and null or unknown string values in the same way. In the plugin-framework empty strings are acknowledged and used because the PF can differentiate
""
from null/unknown strings. This can lead to bugs such as this one, specifically aboutcredentials
: https://github.com/hashicorp/terraform-provider-google/issues/14255.We should have consistent validation on string provider-level arguments but we currently do not.
Fields where validation rejects an empty string value:
Fields currently missing validation for empty strings:
It's worth noting that adding new validation in the schema of the plugin-framework provider is a breaking change:
request_reason=""
that config ran without error, but after upgrading the provider there would be an error returned before planning/applying can start.New or Affected Resource(s)
Potential Terraform Configuration
N/A
References
No response