Validation fails when assigning a nested resource argument

Hello,
I would like to create an Artifactory permission target resource, and followed the example provided here

However I am getting this validation error. What could be the issue?
Thanks.

resource "artifactory_permission_target" "test-perm" {
  name = "test-perm"

  repo = {
    includes_pattern = ["foo/**"]
    excludes_pattern = ["bar/**"]
    repositories     = ["example-repo-local"]

    actions = {
      users = [
        {
          name        = "anonymous"
          permissions = ["read", "write"]
        },
      ]

      groups = [
        {
          name        = "readers"
          permissions = ["read"]
        },
      ]
    }
  }
$ terraform validate
Error: Unsupported argument

  on artifactory//main.tf line 287, in resource "artifactory_permission_target" "test-perm":
 287:   repo = {

An argument named "repo" is not expected here. Did you mean to define a block
of type "repo"?

Error: Unsupported argument

  on artifactory//main.tf line 309, in resource "artifactory_permission_target" "test-perm":
 309:   build = {

An argument named "build" is not expected here. Did you mean to define a block
of type "build"?

The documentation for this resource type doesn’t seem to actually match the schema that the provider is returning: repo and build are declared by the provider itself as names of nested block types, rather than as direct arguments.

Therefore I think the solution is to change your configuration to match the configuration schema that the provider actually declares, rather than the one that is documented. In this case, that means to remove the = from the declaration so that it will be understood by Terraform as a nested block of type repo rather than an argument called repo:

  repo {
    includes_pattern = ["foo/**"]
    excludes_pattern = ["bar/**"]
    repositories     = ["example-repo-local"]

    # ...
  }

Depending on how the rest of the resource type schema is set up, you might find similar errors to this for nested blocks inside the repo and build blocks. If so, the solution to each one will be similar.