@@ -243,101 +243,52 @@ func TestDefinitionValidateImplementation(t *testing.T) {
243
243
definition : function.Definition {
244
244
Parameters : []function.Parameter {
245
245
function.MapParameter {
246
+ Name : "map_with_dynamic" ,
246
247
ElementType : types .DynamicType ,
247
248
},
248
249
},
249
250
Return : function.StringReturn {},
250
251
},
251
- expected : diag.Diagnostics {
252
- diag .NewErrorDiagnostic (
253
- "Invalid Function Definition" ,
254
- "When validating the function definition, an implementation issue was found. " +
255
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
256
- "Parameter \" param1\" at position 0 contains a collection type with a nested dynamic type.\n \n " +
257
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
258
- "If underlying dynamic values are required, replace the \" param1\" parameter definition with DynamicParameter instead." ,
259
- ),
260
- },
261
- },
262
- "variadic-param-dynamic-in-collection" : {
263
- definition : function.Definition {
264
- Parameters : []function.Parameter {
265
- function.StringParameter {},
266
- function.StringParameter {},
267
- },
268
- VariadicParameter : function.SetParameter {
269
- ElementType : types .DynamicType ,
270
- },
271
- Return : function.StringReturn {},
272
- },
273
- expected : diag.Diagnostics {
274
- diag .NewErrorDiagnostic (
275
- "Invalid Function Definition" ,
276
- "When validating the function definition, an implementation issue was found. " +
277
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
278
- "Variadic parameter \" varparam\" contains a collection type with a nested dynamic type.\n \n " +
279
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
280
- "If underlying dynamic values are required, replace the variadic parameter definition with DynamicParameter instead." ,
281
- ),
282
- },
283
- },
284
- "return-dynamic-in-collection" : {
285
- definition : function.Definition {
286
- Return : function.ListReturn {
287
- ElementType : types .DynamicType ,
288
- },
289
- },
290
- expected : diag.Diagnostics {
291
- diag .NewErrorDiagnostic (
292
- "Invalid Function Definition" ,
293
- "When validating the function definition, an implementation issue was found. " +
294
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
295
- "Return contains a collection type with a nested dynamic type.\n \n " +
296
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
297
- "If underlying dynamic values are required, replace the return definition with DynamicReturn instead." ,
298
- ),
299
- },
300
- },
301
- "param-dynamic-in-collection" : {
302
- definition : function.Definition {
303
- Parameters : []function.Parameter {
304
- function.MapParameter {
305
- ElementType : types .DynamicType ,
306
- },
252
+ expected : function.DefinitionValidateResponse {
253
+ Diagnostics : diag.Diagnostics {
254
+ diag .NewErrorDiagnostic (
255
+ "Invalid Function Definition" ,
256
+ "When validating the function definition, an implementation issue was found. " +
257
+ "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
258
+ "Parameter \" map_with_dynamic\" at position 0 contains a collection type with a nested dynamic type.\n \n " +
259
+ "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
260
+ "If underlying dynamic values are required, replace the \" map_with_dynamic\" parameter definition with DynamicParameter instead." ,
261
+ ),
307
262
},
308
- Return : function.StringReturn {},
309
- },
310
- expected : diag.Diagnostics {
311
- diag .NewErrorDiagnostic (
312
- "Invalid Function Definition" ,
313
- "When validating the function definition, an implementation issue was found. " +
314
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
315
- "Parameter \" param1\" at position 0 contains a collection type with a nested dynamic type.\n \n " +
316
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
317
- "If underlying dynamic values are required, replace the \" param1\" parameter definition with DynamicParameter instead." ,
318
- ),
319
263
},
320
264
},
321
265
"variadic-param-dynamic-in-collection" : {
322
266
definition : function.Definition {
323
267
Parameters : []function.Parameter {
324
- function.StringParameter {},
325
- function.StringParameter {},
268
+ function.StringParameter {
269
+ Name : "string_param1" ,
270
+ },
271
+ function.StringParameter {
272
+ Name : "string_param2" ,
273
+ },
326
274
},
327
275
VariadicParameter : function.SetParameter {
276
+ Name : "set_with_dynamic" ,
328
277
ElementType : types .DynamicType ,
329
278
},
330
279
Return : function.StringReturn {},
331
280
},
332
- expected : diag.Diagnostics {
333
- diag .NewErrorDiagnostic (
334
- "Invalid Function Definition" ,
335
- "When validating the function definition, an implementation issue was found. " +
336
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
337
- "Variadic parameter \" varparam\" contains a collection type with a nested dynamic type.\n \n " +
338
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
339
- "If underlying dynamic values are required, replace the variadic parameter definition with DynamicParameter instead." ,
340
- ),
281
+ expected : function.DefinitionValidateResponse {
282
+ Diagnostics : diag.Diagnostics {
283
+ diag .NewErrorDiagnostic (
284
+ "Invalid Function Definition" ,
285
+ "When validating the function definition, an implementation issue was found. " +
286
+ "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
287
+ "Variadic parameter \" set_with_dynamic\" contains a collection type with a nested dynamic type.\n \n " +
288
+ "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
289
+ "If underlying dynamic values are required, replace the variadic parameter definition with DynamicParameter instead." ,
290
+ ),
291
+ },
341
292
},
342
293
},
343
294
"return-dynamic-in-collection" : {
@@ -346,15 +297,17 @@ func TestDefinitionValidateImplementation(t *testing.T) {
346
297
ElementType : types .DynamicType ,
347
298
},
348
299
},
349
- expected : diag.Diagnostics {
350
- diag .NewErrorDiagnostic (
351
- "Invalid Function Definition" ,
352
- "When validating the function definition, an implementation issue was found. " +
353
- "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
354
- "Return contains a collection type with a nested dynamic type.\n \n " +
355
- "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
356
- "If underlying dynamic values are required, replace the return definition with DynamicReturn instead." ,
357
- ),
300
+ expected : function.DefinitionValidateResponse {
301
+ Diagnostics : diag.Diagnostics {
302
+ diag .NewErrorDiagnostic (
303
+ "Invalid Function Definition" ,
304
+ "When validating the function definition, an implementation issue was found. " +
305
+ "This is always an issue with the provider and should be reported to the provider developers.\n \n " +
306
+ "Return contains a collection type with a nested dynamic type.\n \n " +
307
+ "Dynamic types inside of collections are not currently supported in terraform-plugin-framework. " +
308
+ "If underlying dynamic values are required, replace the return definition with DynamicReturn instead." ,
309
+ ),
310
+ },
358
311
},
359
312
},
360
313
"conflicting-param-names" : {
0 commit comments