Skip to content

Commit 5b61213

Browse files
committed
provider/schema: Initial package
Reference: #132 Reference: #326 Reference: #437 Reference: #491 Reference: #508 Reference: #532 This change introduces a new `provider/schema` package, which contains schema interfaces and types relevant to providers, such as omitting `Computed`, plan modifiers, and schema versioning. This new schema implementation also provides strongly typed attributes, nested attributes, and blocks with customizable types. Nested attributes and blocks are exposed with a separate nested object for customization and validation. The implementation leans heavily on the design choice of the framework being responsible for preventing provider developer runtime errors. The tailored fields no longer expose functionality that is not available for providers. The framework design will also raise compiler-time errors for errant typing of validators. No changes are required for data handling in the `Read` method. Example definition: ```go package test import ( "context" "github.com/bflad/terraform-plugin-framework-type-time/timetypes" "github.com/hashicorp/terraform-plugin-framework-validators/float64validator" "github.com/hashicorp/terraform-plugin-framework-validators/listvalidator" "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" "github.com/hashicorp/terraform-plugin-framework/provider" "github.com/hashicorp/terraform-plugin-framework/provider/schema" "github.com/hashicorp/terraform-plugin-framework/schema/validator" "github.com/hashicorp/terraform-plugin-framework/types" ) type ExampleCloudProvider struct{} func (p ExampleCloudProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { resp.Schema = schema.Schema{ Attributes: map[string]schema.Attribute{ "string_attribute": schema.StringAttribute{ Required: true, Validators: []validator.String{ stringvalidator.LengthBetween(3, 256), }, }, "custom_string_attribute": schema.StringAttribute{ CustomType: timetypes.RFC3339Type, Optional: true, }, "list_attribute": schema.ListAttribute{ ElementType: types.StringType, Optional: true, }, "list_nested_attribute": schema.ListNestedAttribute{ NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{ "bool_attribute": schema.BoolAttribute{ Optional: true, }, }, Validators: []validator.Object{ /*...*/ }, }, Optional: true, Validators: []validator.List{ listvalidator.SizeAtMost(2), }, }, "single_nested_attribute": schema.SingleNestedAttribute{ Attributes: map[string]schema.Attribute{ "int64_attribute": schema.Int64Attribute{ Optional: true, }, }, Optional: true, }, }, Blocks: map[string]schema.Block{ "list_block": schema.ListNestedBlock{ NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{ "float64_attribute": schema.Float64Attribute{ Optional: true, Validators: []validator.Float64{ float64validator.OneOf(1.2, 2.4), }, }, }, Validators: []validator.Object{ /*...*/ }, }, Validators: []validator.List{ listvalidator.SizeAtMost(2), }, }, }, } } ``` To migrate a provider schema: - Add `github.com/hashicorp/terraform-plugin-framework/provider/schema` to the `import` statement - Switch the `provider.Provider` implementation `GetSchema` method to `Schema` whose response includes a `schema.Schema` from the new package. Prior implementation: ```go func (p ExampleCloudProvider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) { return tfsdk.Schema{/* ... */}, nil } ``` Migrated implementation: ```go func (p ExampleCloudProvider) Schema(ctx context.Context, req provider.SchemaRequest, resp *provider.SchemaResponse) { resp.Schema = schema.Schema{/*...*/} } ``` If the provider requires no schema, the method can be entirely empty. - Switch `map[string]tfsdk.Attribute` with `map[string]schema.Attribute` - Switch `map[string]tfsdk.Block` with `map[string]schema.Block` - Switch individual attribute and block definitions. Unless the code was already taking advantage of custom attribute types (uncommon so far), the `Type` field will be removed and the map entries must declare the typed implementation, e.g. a `tfsdk.Attribute` with `Type: types.StringType` is equivalent to `schema.StringAttribute`. Custom attribute types can be specified via the `CustomType` field in each of the implementations. Prior primitive type (`types.BoolType`, `types.Float64Type`, `types.Int64Type`, `types.NumberType`, `types.StringType`) attribute implementation: ```go // The "tfsdk.Attribute" could be omitted inside a map[string]tfsdk.Attribute tfsdk.Attribute{ Required: true, Type: types.StringType, } ``` Migrated implementation: ```go // The schema.XXXAttribute must be declared inside map[string]schema.Attribute schema.StringAttribute{ Required: true, } ``` Prior collection type (`types.ListType`, `types.MapType`, `types.SetType`) attribute implementation: ```go // The "tfsdk.Attribute" could be omitted inside a map[string]tfsdk.Attribute tfsdk.Attribute{ Required: true, Type: types.ListType{ ElemType: types.StringType, }, } ``` Migrated implementation: ```go // The schema.XXXAttribute must be declared inside map[string]schema.Attribute schema.ListAttribute{ ElementType: types.StringType, Required: true, } ``` Prior single nested attributes type (`tfsdk.SingleNestedAttributes()`) attribute implementation: ```go // The "tfsdk.Attribute" could be omitted inside a map[string]tfsdk.Attribute tfsdk.Attribute{ Attributes: tfsdk.SingleNestedAttributes(map[string]tfsdk.Attribute{/*...*/}), Required: true, }, ``` Migrated implementation: ```go // The schema.XXXAttribute must be declared inside map[string]schema.Attribute schema.SingleNestedAttribute{ Attributes: map[string]schema.Attribute{/*...*/}, Required: true, } ``` Prior collection nested attributes type (`tfsdk.ListNestedAttributes()`, `tfsdk.MapNestedAttributes()`, `tfsdk.SetNestedAttributes()`) attribute implementation: ```go // The "tfsdk.Attribute" could be omitted inside a map[string]tfsdk.Attribute tfsdk.Attribute{ Attributes: tfsdk.ListNestedAttributes(map[string]tfsdk.Attribute{/*...*/}), Required: true, }, ``` Migrated implementation: ```go // The schema.XXXAttribute must be declared inside map[string]schema.Attribute schema.ListNestedAttribute{ NestedObject: schema.NestedAttributeObject{ Attributes: map[string]schema.Attribute{/*...*/}, }, Required: true, } ``` Prior collection blocks type (`tfsdk.Block`) attribute implementation: ```go // The "tfsdk.Block" could be omitted inside a map[string]tfsdk.Block tfsdk.Block{ Attributes: map[string]tfsdk.Attribute{/*...*/}, Blocks: map[string]tfsdk.Block{/*...*/}, NestingMode: tfsdk.BlockNestingModeList, }, ``` Migrated implementation: ```go // The schema.XXXBlock must be declared inside map[string]schema.Block schema.ListNestedBlock{ NestedObject: schema.NestedBlockObject{ Attributes: map[string]schema.Attribute{/*...*/}, Blocks: map[string]schema.Block{/*...*/}, }, } ```
1 parent 4bd82c9 commit 5b61213

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+12969
-228
lines changed

.changelog/pending.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
```release-note:note
2+
provider: The `Provider` type `GetSchema` method has been deprecated. Use the `Schema` method instead.
3+
```
4+
5+
```release-note:feature
6+
provider/schema: New package which contains schema interfaces and types relevant to providers
7+
```

internal/fwserver/server.go

+25-6
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,31 @@ func (s *Server) ProviderSchema(ctx context.Context) (fwschema.Schema, diag.Diag
282282
return s.providerSchema, s.providerSchemaDiags
283283
}
284284

285-
logging.FrameworkDebug(ctx, "Calling provider defined Provider GetSchema")
286-
providerSchema, diags := s.Provider.GetSchema(ctx)
287-
logging.FrameworkDebug(ctx, "Called provider defined Provider GetSchema")
288-
289-
s.providerSchema = &providerSchema
290-
s.providerSchemaDiags = diags
285+
switch providerIface := s.Provider.(type) {
286+
case provider.ProviderWithSchema:
287+
schemaReq := provider.SchemaRequest{}
288+
schemaResp := provider.SchemaResponse{}
289+
290+
logging.FrameworkDebug(ctx, "Calling provider defined Provider Schema")
291+
providerIface.Schema(ctx, schemaReq, &schemaResp)
292+
logging.FrameworkDebug(ctx, "Called provider defined Provider Schema")
293+
294+
s.providerSchema = schemaResp.Schema
295+
s.providerSchemaDiags = schemaResp.Diagnostics
296+
case provider.ProviderWithGetSchema:
297+
logging.FrameworkDebug(ctx, "Calling provider defined Provider GetSchema")
298+
schema, diags := providerIface.GetSchema(ctx) //nolint:staticcheck // Required internal usage until removal
299+
logging.FrameworkDebug(ctx, "Called provider defined Provider GetSchema")
300+
301+
s.providerSchema = schema
302+
s.providerSchemaDiags = diags
303+
default:
304+
s.providerSchemaDiags.AddError(
305+
"Provier Missing Schema",
306+
"While attempting to load provider schemas, the provider itself was missing a Schema method. "+
307+
"This is always an issue in the provider and should be reported to the provider developers.",
308+
)
309+
}
291310

292311
return s.providerSchema, s.providerSchemaDiags
293312
}

internal/fwserver/server_configureprovider_test.go

+10-18
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/hashicorp/terraform-plugin-framework/internal/testing/testprovider"
1111
"github.com/hashicorp/terraform-plugin-framework/path"
1212
"github.com/hashicorp/terraform-plugin-framework/provider"
13+
"github.com/hashicorp/terraform-plugin-framework/provider/schema"
1314
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1415
"github.com/hashicorp/terraform-plugin-framework/types"
1516
"github.com/hashicorp/terraform-plugin-go/tftypes"
@@ -28,11 +29,10 @@ func TestServerConfigureProvider(t *testing.T) {
2829
"test": tftypes.NewValue(tftypes.String, "test-value"),
2930
})
3031

31-
testSchema := tfsdk.Schema{
32-
Attributes: map[string]tfsdk.Attribute{
33-
"test": {
32+
testSchema := schema.Schema{
33+
Attributes: map[string]schema.Attribute{
34+
"test": schema.StringAttribute{
3435
Required: true,
35-
Type: types.StringType,
3636
},
3737
},
3838
}
@@ -56,8 +56,8 @@ func TestServerConfigureProvider(t *testing.T) {
5656
"request-config": {
5757
server: &fwserver.Server{
5858
Provider: &testprovider.Provider{
59-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
60-
return testSchema, nil
59+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
60+
resp.Schema = testSchema
6161
},
6262
ConfigureMethod: func(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
6363
var got types.String
@@ -82,9 +82,7 @@ func TestServerConfigureProvider(t *testing.T) {
8282
"request-terraformversion": {
8383
server: &fwserver.Server{
8484
Provider: &testprovider.Provider{
85-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
86-
return tfsdk.Schema{}, nil
87-
},
85+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {},
8886
ConfigureMethod: func(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
8987
if req.TerraformVersion != "1.0.0" {
9088
resp.Diagnostics.AddError("Incorrect req.TerraformVersion", "expected 1.0.0, got "+req.TerraformVersion)
@@ -100,9 +98,7 @@ func TestServerConfigureProvider(t *testing.T) {
10098
"response-datasourcedata": {
10199
server: &fwserver.Server{
102100
Provider: &testprovider.Provider{
103-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
104-
return tfsdk.Schema{}, nil
105-
},
101+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {},
106102
ConfigureMethod: func(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
107103
resp.DataSourceData = "test-provider-configure-value"
108104
},
@@ -116,9 +112,7 @@ func TestServerConfigureProvider(t *testing.T) {
116112
"response-diagnostics": {
117113
server: &fwserver.Server{
118114
Provider: &testprovider.Provider{
119-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
120-
return tfsdk.Schema{}, nil
121-
},
115+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {},
122116
ConfigureMethod: func(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
123117
resp.Diagnostics.AddWarning("warning summary", "warning detail")
124118
resp.Diagnostics.AddError("error summary", "error detail")
@@ -142,9 +136,7 @@ func TestServerConfigureProvider(t *testing.T) {
142136
"response-resourcedata": {
143137
server: &fwserver.Server{
144138
Provider: &testprovider.Provider{
145-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
146-
return tfsdk.Schema{}, nil
147-
},
139+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {},
148140
ConfigureMethod: func(ctx context.Context, req provider.ConfigureRequest, resp *provider.ConfigureResponse) {
149141
resp.ResourceData = "test-provider-configure-value"
150142
},

internal/fwserver/server_getproviderschema_test.go

+44-45
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import (
66

77
"github.com/google/go-cmp/cmp"
88
"github.com/hashicorp/terraform-plugin-framework/datasource"
9-
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
9+
datasourceschema "github.com/hashicorp/terraform-plugin-framework/datasource/schema"
1010
"github.com/hashicorp/terraform-plugin-framework/diag"
1111
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
1212
"github.com/hashicorp/terraform-plugin-framework/internal/fwserver"
1313
"github.com/hashicorp/terraform-plugin-framework/internal/testing/testprovider"
1414
"github.com/hashicorp/terraform-plugin-framework/provider"
15+
providerschema "github.com/hashicorp/terraform-plugin-framework/provider/schema"
1516
"github.com/hashicorp/terraform-plugin-framework/resource"
1617
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
1718
"github.com/hashicorp/terraform-plugin-framework/types"
@@ -31,7 +32,7 @@ func TestServerGetProviderSchema(t *testing.T) {
3132
},
3233
expectedResponse: &fwserver.GetProviderSchemaResponse{
3334
DataSourceSchemas: map[string]fwschema.Schema{},
34-
Provider: &tfsdk.Schema{},
35+
Provider: providerschema.Schema{},
3536
ResourceSchemas: map[string]fwschema.Schema{},
3637
ServerCapabilities: &fwserver.ServerCapabilities{
3738
PlanDestroy: true,
@@ -46,9 +47,9 @@ func TestServerGetProviderSchema(t *testing.T) {
4647
func() datasource.DataSource {
4748
return &testprovider.DataSource{
4849
SchemaMethod: func(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
49-
resp.Schema = schema.Schema{
50-
Attributes: map[string]schema.Attribute{
51-
"test1": schema.StringAttribute{
50+
resp.Schema = datasourceschema.Schema{
51+
Attributes: map[string]datasourceschema.Attribute{
52+
"test1": datasourceschema.StringAttribute{
5253
Required: true,
5354
},
5455
},
@@ -62,9 +63,9 @@ func TestServerGetProviderSchema(t *testing.T) {
6263
func() datasource.DataSource {
6364
return &testprovider.DataSource{
6465
SchemaMethod: func(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
65-
resp.Schema = schema.Schema{
66-
Attributes: map[string]schema.Attribute{
67-
"test2": schema.StringAttribute{
66+
resp.Schema = datasourceschema.Schema{
67+
Attributes: map[string]datasourceschema.Attribute{
68+
"test2": datasourceschema.StringAttribute{
6869
Required: true,
6970
},
7071
},
@@ -82,22 +83,22 @@ func TestServerGetProviderSchema(t *testing.T) {
8283
request: &fwserver.GetProviderSchemaRequest{},
8384
expectedResponse: &fwserver.GetProviderSchemaResponse{
8485
DataSourceSchemas: map[string]fwschema.Schema{
85-
"test_data_source1": schema.Schema{
86-
Attributes: map[string]schema.Attribute{
87-
"test1": schema.StringAttribute{
86+
"test_data_source1": datasourceschema.Schema{
87+
Attributes: map[string]datasourceschema.Attribute{
88+
"test1": datasourceschema.StringAttribute{
8889
Required: true,
8990
},
9091
},
9192
},
92-
"test_data_source2": schema.Schema{
93-
Attributes: map[string]schema.Attribute{
94-
"test2": schema.StringAttribute{
93+
"test_data_source2": datasourceschema.Schema{
94+
Attributes: map[string]datasourceschema.Attribute{
95+
"test2": datasourceschema.StringAttribute{
9596
Required: true,
9697
},
9798
},
9899
},
99100
},
100-
Provider: &tfsdk.Schema{},
101+
Provider: providerschema.Schema{},
101102
ResourceSchemas: map[string]fwschema.Schema{},
102103
ServerCapabilities: &fwserver.ServerCapabilities{
103104
PlanDestroy: true,
@@ -112,9 +113,9 @@ func TestServerGetProviderSchema(t *testing.T) {
112113
func() datasource.DataSource {
113114
return &testprovider.DataSource{
114115
SchemaMethod: func(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
115-
resp.Schema = schema.Schema{
116-
Attributes: map[string]schema.Attribute{
117-
"test1": schema.StringAttribute{
116+
resp.Schema = datasourceschema.Schema{
117+
Attributes: map[string]datasourceschema.Attribute{
118+
"test1": datasourceschema.StringAttribute{
118119
Required: true,
119120
},
120121
},
@@ -128,9 +129,9 @@ func TestServerGetProviderSchema(t *testing.T) {
128129
func() datasource.DataSource {
129130
return &testprovider.DataSource{
130131
SchemaMethod: func(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
131-
resp.Schema = schema.Schema{
132-
Attributes: map[string]schema.Attribute{
133-
"test2": schema.StringAttribute{
132+
resp.Schema = datasourceschema.Schema{
133+
Attributes: map[string]datasourceschema.Attribute{
134+
"test2": datasourceschema.StringAttribute{
134135
Required: true,
135136
},
136137
},
@@ -156,7 +157,7 @@ func TestServerGetProviderSchema(t *testing.T) {
156157
"This is always an issue with the provider and should be reported to the provider developers.",
157158
),
158159
},
159-
Provider: &tfsdk.Schema{},
160+
Provider: providerschema.Schema{},
160161
ResourceSchemas: map[string]fwschema.Schema{},
161162
ServerCapabilities: &fwserver.ServerCapabilities{
162163
PlanDestroy: true,
@@ -189,7 +190,7 @@ func TestServerGetProviderSchema(t *testing.T) {
189190
"This is always an issue with the provider and should be reported to the provider developers.",
190191
),
191192
},
192-
Provider: &tfsdk.Schema{},
193+
Provider: providerschema.Schema{},
193194
ResourceSchemas: map[string]fwschema.Schema{},
194195
ServerCapabilities: &fwserver.ServerCapabilities{
195196
PlanDestroy: true,
@@ -208,9 +209,9 @@ func TestServerGetProviderSchema(t *testing.T) {
208209
func() datasource.DataSource {
209210
return &testprovider.DataSource{
210211
SchemaMethod: func(_ context.Context, _ datasource.SchemaRequest, resp *datasource.SchemaResponse) {
211-
resp.Schema = schema.Schema{
212-
Attributes: map[string]schema.Attribute{
213-
"test": schema.StringAttribute{
212+
resp.Schema = datasourceschema.Schema{
213+
Attributes: map[string]datasourceschema.Attribute{
214+
"test": datasourceschema.StringAttribute{
214215
Required: true,
215216
},
216217
},
@@ -229,15 +230,15 @@ func TestServerGetProviderSchema(t *testing.T) {
229230
request: &fwserver.GetProviderSchemaRequest{},
230231
expectedResponse: &fwserver.GetProviderSchemaResponse{
231232
DataSourceSchemas: map[string]fwschema.Schema{
232-
"testprovidertype_data_source": schema.Schema{
233-
Attributes: map[string]schema.Attribute{
234-
"test": schema.StringAttribute{
233+
"testprovidertype_data_source": datasourceschema.Schema{
234+
Attributes: map[string]datasourceschema.Attribute{
235+
"test": datasourceschema.StringAttribute{
235236
Required: true,
236237
},
237238
},
238239
},
239240
},
240-
Provider: &tfsdk.Schema{},
241+
Provider: providerschema.Schema{},
241242
ResourceSchemas: map[string]fwschema.Schema{},
242243
ServerCapabilities: &fwserver.ServerCapabilities{
243244
PlanDestroy: true,
@@ -247,26 +248,24 @@ func TestServerGetProviderSchema(t *testing.T) {
247248
"provider": {
248249
server: &fwserver.Server{
249250
Provider: &testprovider.Provider{
250-
GetSchemaMethod: func(_ context.Context) (tfsdk.Schema, diag.Diagnostics) {
251-
return tfsdk.Schema{
252-
Attributes: map[string]tfsdk.Attribute{
253-
"test": {
251+
SchemaMethod: func(_ context.Context, _ provider.SchemaRequest, resp *provider.SchemaResponse) {
252+
resp.Schema = providerschema.Schema{
253+
Attributes: map[string]providerschema.Attribute{
254+
"test": providerschema.StringAttribute{
254255
Required: true,
255-
Type: types.StringType,
256256
},
257257
},
258-
}, nil
258+
}
259259
},
260260
},
261261
},
262262
request: &fwserver.GetProviderSchemaRequest{},
263263
expectedResponse: &fwserver.GetProviderSchemaResponse{
264264
DataSourceSchemas: map[string]fwschema.Schema{},
265-
Provider: &tfsdk.Schema{
266-
Attributes: map[string]tfsdk.Attribute{
267-
"test": {
265+
Provider: providerschema.Schema{
266+
Attributes: map[string]providerschema.Attribute{
267+
"test": providerschema.StringAttribute{
268268
Required: true,
269-
Type: types.StringType,
270269
},
271270
},
272271
},
@@ -295,7 +294,7 @@ func TestServerGetProviderSchema(t *testing.T) {
295294
request: &fwserver.GetProviderSchemaRequest{},
296295
expectedResponse: &fwserver.GetProviderSchemaResponse{
297296
DataSourceSchemas: map[string]fwschema.Schema{},
298-
Provider: &tfsdk.Schema{},
297+
Provider: providerschema.Schema{},
299298
ProviderMeta: &tfsdk.Schema{
300299
Attributes: map[string]tfsdk.Attribute{
301300
"test": {
@@ -356,7 +355,7 @@ func TestServerGetProviderSchema(t *testing.T) {
356355
request: &fwserver.GetProviderSchemaRequest{},
357356
expectedResponse: &fwserver.GetProviderSchemaResponse{
358357
DataSourceSchemas: map[string]fwschema.Schema{},
359-
Provider: &tfsdk.Schema{},
358+
Provider: providerschema.Schema{},
360359
ResourceSchemas: map[string]fwschema.Schema{
361360
"test_resource1": tfsdk.Schema{
362361
Attributes: map[string]tfsdk.Attribute{
@@ -434,7 +433,7 @@ func TestServerGetProviderSchema(t *testing.T) {
434433
"This is always an issue with the provider and should be reported to the provider developers.",
435434
),
436435
},
437-
Provider: &tfsdk.Schema{},
436+
Provider: providerschema.Schema{},
438437
ResourceSchemas: nil,
439438
ServerCapabilities: &fwserver.ServerCapabilities{
440439
PlanDestroy: true,
@@ -467,7 +466,7 @@ func TestServerGetProviderSchema(t *testing.T) {
467466
"This is always an issue with the provider and should be reported to the provider developers.",
468467
),
469468
},
470-
Provider: &tfsdk.Schema{},
469+
Provider: providerschema.Schema{},
471470
ResourceSchemas: nil,
472471
ServerCapabilities: &fwserver.ServerCapabilities{
473472
PlanDestroy: true,
@@ -508,7 +507,7 @@ func TestServerGetProviderSchema(t *testing.T) {
508507
request: &fwserver.GetProviderSchemaRequest{},
509508
expectedResponse: &fwserver.GetProviderSchemaResponse{
510509
DataSourceSchemas: map[string]fwschema.Schema{},
511-
Provider: &tfsdk.Schema{},
510+
Provider: providerschema.Schema{},
512511
ResourceSchemas: map[string]fwschema.Schema{
513512
"testprovidertype_resource": tfsdk.Schema{
514513
Attributes: map[string]tfsdk.Attribute{

0 commit comments

Comments
 (0)