You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Framework allows top-level schema attributes that conflict with Terraform meta-arguments (#548)
* Adding Validate() function to provider, resource and data source schema and to provider metaschema to prevent the use of reserved names for top-level attributes and blocks and invalid names for attributes and blocks at any level of nesting (#136)
* Apply suggestions from code review
Co-authored-by: Brian Flad <[email protected]>
Co-authored-by: Brian Flad <[email protected]>
fmt.Sprintf("Field name %q is invalid, the only allowed characters are a-z, 0-9 and _. This is always a problem with the provider and should be reported to the provider developer.", name),
// validateBlockFieldName verifies that the name used for a block complies with the regular
215
+
// expression defined in validFieldNameRegex.
216
+
funcvalidateBlockFieldName(path path.Path, namestring, b fwschema.Block) diag.Diagnostics {
217
+
vardiags diag.Diagnostics
218
+
219
+
if!validFieldNameRegex.MatchString(name) {
220
+
diags.AddAttributeError(
221
+
path,
222
+
"Invalid Schema Field Name",
223
+
fmt.Sprintf("Field name %q is invalid, the only allowed characters are a-z, 0-9 and _. This is always a problem with the provider and should be reported to the provider developer.", name),
0 commit comments