Hi !
I’m trying to figure out if this thing is possiable :
I have a schema, and I want to set the ElementType
of the ‘default’ key based on the type value. For example, if the type is a string, I want to set it as types.String
. If it’s a number, I want to set it as types.Int64
, and so on.
MarkdownDescription: "The items of the array property",
Optional: true,
Attributes: map[string]schema.Attribute{
"type": schema.StringAttribute{
MarkdownDescription: "The type of the items",
Required: true,
// Validators: []validator.String{stringvalidator.OneOf("STRING", "BOOLEAN", "INTEGER", "FLOAT", "OBJECT", "ARRAY")},
},
"format": schema.StringAttribute{
MarkdownDescription: "The format of the items",
Optional: true,
},
"default": schema.ListAttribute{
MarkdownDescription: "The default of the items",
Computed: true,
},
},
}`