hashicorp / hashicorp/terraform-plugin-framework

Replace internal/reflect.isValidFieldName with internal/fwschema.IsValidAttributeName

Open
#725 0 comments 0 reactions 0 assignees View on GitHub
tech-debt
Dominant language
Go
Stars
384
Forks
107
Avg merge
3m
Merged PRs (30d)
1

Description

### Module version

```
v1.2.0
```

### Use-cases

There are multiple places in the internal logic, such as the `internal/reflect` package `isValidFieldName` function, which contain the checking logic for valid attribute names. The `internal/fwschema` implementation contains a pre-compiled regular expression, which may give a very slight performance bump since its called every time struct tags are handled, for example.

### Proposal

On the tin -- centralize logic to `internal/fwschema` since that should contain everything about "schemas".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.