From 05a1bfe2806299f8090f4ca46ee4d0d5350565c0 Mon Sep 17 00:00:00 2001 From: Sean Conroy Date: Wed, 11 Sep 2024 11:58:26 +0100 Subject: [PATCH] Resolve schema issue --- docs/resources/transport_t1_e1_controller_feature.md | 1 + .../profile_parcels/transport_t1_e1_controller.yaml | 2 +- .../resource_sdwan_transport_t1_e1_controller_feature.go | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/resources/transport_t1_e1_controller_feature.md b/docs/resources/transport_t1_e1_controller_feature.md index 2df9ae74..319790e0 100644 --- a/docs/resources/transport_t1_e1_controller_feature.md +++ b/docs/resources/transport_t1_e1_controller_feature.md @@ -70,6 +70,7 @@ resource "sdwan_transport_t1_e1_controller_feature" "example" { Optional: - `cable_length` (String) Cable Config + - Choices: `short`, `long` - `channel_groups` (Attributes List) Channel Group List (see [below for nested schema](#nestedatt--entries--channel_groups)) - `clock_source` (String) Clock Source - Choices: `line`, `internal`, `loop-timed`, `network` diff --git a/gen/definitions/profile_parcels/transport_t1_e1_controller.yaml b/gen/definitions/profile_parcels/transport_t1_e1_controller.yaml index c6eca8be..86cd4a42 100644 --- a/gen/definitions/profile_parcels/transport_t1_e1_controller.yaml +++ b/gen/definitions/profile_parcels/transport_t1_e1_controller.yaml @@ -56,7 +56,7 @@ attributes: example: ami - model_name: cableLength data_path: [cable] - enum: [short, long] + enum_values: [short, long] type: String example: "long" - model_name: lengthShort diff --git a/internal/provider/resource_sdwan_transport_t1_e1_controller_feature.go b/internal/provider/resource_sdwan_transport_t1_e1_controller_feature.go index 4b00ee16..6df52eee 100644 --- a/internal/provider/resource_sdwan_transport_t1_e1_controller_feature.go +++ b/internal/provider/resource_sdwan_transport_t1_e1_controller_feature.go @@ -170,8 +170,11 @@ func (r *TransportT1E1ControllerProfileParcelResource) Schema(ctx context.Contex Optional: true, }, "cable_length": schema.StringAttribute{ - MarkdownDescription: helpers.NewAttributeDescription("Cable Config").String, + MarkdownDescription: helpers.NewAttributeDescription("Cable Config").AddStringEnumDescription("short", "long").String, Optional: true, + Validators: []validator.String{ + stringvalidator.OneOf("short", "long"), + }, }, "length_short": schema.StringAttribute{ MarkdownDescription: helpers.NewAttributeDescription("length").AddStringEnumDescription("110ft", "220ft", "330ft", "440ft", "550ft", "660ft").String,