Skip to content

Commit 8d5084d

Browse files
committed
Update wrapped actions for simplified actions
1 parent f123fbd commit 8d5084d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

internal/provider/framework/wrap.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"context"
88

99
"github.com/hashicorp/terraform-plugin-framework/action"
10-
aschema "github.com/hashicorp/terraform-plugin-framework/action/schema"
1110
"github.com/hashicorp/terraform-plugin-framework/datasource"
1211
"github.com/hashicorp/terraform-plugin-framework/diag"
1312
"github.com/hashicorp/terraform-plugin-framework/ephemeral"
@@ -441,14 +440,10 @@ func (w *wrappedAction) Schema(ctx context.Context, request action.SchemaRequest
441440

442441
// Validate the action's model against the schema.
443442
if v, ok := w.inner.(framework.ActionValidateModel); ok {
444-
if schema, ok := response.Schema.(aschema.UnlinkedSchema); ok {
445-
response.Diagnostics.Append(v.ValidateModel(ctx, &schema)...)
446-
if response.Diagnostics.HasError() {
447-
response.Diagnostics.AddError("action model validation error", w.spec.TypeName)
448-
return
449-
}
450-
} else {
451-
response.Diagnostics.AddError("unsupported action schema type", w.spec.TypeName)
443+
response.Diagnostics.Append(v.ValidateModel(ctx, &response.Schema)...)
444+
if response.Diagnostics.HasError() {
445+
response.Diagnostics.AddError("action model validation error", w.spec.TypeName)
446+
return
452447
}
453448
} else {
454449
response.Diagnostics.AddError("missing framework.ActionValidateModel", w.spec.TypeName)

0 commit comments

Comments
 (0)