Document possible values of schema fields (#455)

* Document possible values of schema fields

* Change from possible to supported
This commit is contained in:
João Palet 2024-07-09 13:14:38 +01:00 committed by GitHub
parent 846a2ba181
commit 3fb28d1248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 76 additions and 15 deletions

View file

@ -114,6 +114,8 @@ func (r *zoneResource) Configure(ctx context.Context, req resource.ConfigureRequ
// Schema defines the schema for the resource.
func (r *zoneResource) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
primaryOptions := []string{"primary", "secondary"}
resp.Schema = schema.Schema{
Description: "DNS Zone resource schema.",
Attributes: map[string]schema.Attribute{
@ -254,12 +256,12 @@ func (r *zoneResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
},
},
"type": schema.StringAttribute{
Description: "Zone type. Defaults to `primary`",
Description: "Zone type. Defaults to `primary`. " + utils.SupportedValuesDocumentation(primaryOptions),
Optional: true,
Computed: true,
Default: stringdefault.StaticString("primary"),
Validators: []validator.String{
stringvalidator.OneOf("primary", "secondary"),
stringvalidator.OneOf(primaryOptions...),
},
},
"primary_name_server": schema.StringAttribute{