From 3931259b4b34c45280270f40aa20b51e5f3e5adb Mon Sep 17 00:00:00 2001 From: brookesargent Date: Fri, 20 Dec 2024 09:10:39 -0500 Subject: [PATCH] make sure the schema defines variable in the right place --- internal/provider/notification_recipients.go | 48 ++++++++++---------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/internal/provider/notification_recipients.go b/internal/provider/notification_recipients.go index fb736269..1421379b 100644 --- a/internal/provider/notification_recipients.go +++ b/internal/provider/notification_recipients.go @@ -85,30 +85,32 @@ func notificationRecipientSchema(allowedTypes []client.RecipientType) schema.Set }, }, }, - }, - }, - "variable": schema.SetNestedBlock{ - Description: "The variables to set with the Webhook notification.", - Validators: []validator.Set{ - setvalidator.SizeAtMost(10), - }, - NestedObject: schema.NestedBlockObject{ - Attributes: map[string]schema.Attribute{ - "name": schema.StringAttribute{ - Required: true, - Description: "The name of the variable", - Validators: []validator.String{ - stringvalidator.LengthBetween(1, 64), - stringvalidator.RegexMatches(webhookTemplateNameRegex, "must be an alphanumeric string beginning with a lowercase letter"), + Blocks: map[string]schema.Block{ + "variable": schema.SetNestedBlock{ + Description: "The variables to set with the webhook notification.", + Validators: []validator.Set{ + setvalidator.SizeAtMost(10), }, - }, - "value": schema.StringAttribute{ - Description: "An optional default value for the variable", - Optional: true, - Computed: true, - Default: stringdefault.StaticString(""), - Validators: []validator.String{ - stringvalidator.LengthAtMost(256), + NestedObject: schema.NestedBlockObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Required: true, + Description: "The name of the variable", + Validators: []validator.String{ + stringvalidator.LengthBetween(1, 64), + stringvalidator.RegexMatches(webhookTemplateNameRegex, "must be an alphanumeric string beginning with a lowercase letter"), + }, + }, + "value": schema.StringAttribute{ + Description: "The variable value", + Optional: true, + Computed: true, + Default: stringdefault.StaticString(""), + Validators: []validator.String{ + stringvalidator.LengthAtMost(256), + }, + }, + }, }, }, },