in pkg/data_provider_schema.go [72:87]
func (r *ProviderSchemaData) convertAttributeSchemas(attrs map[string]*tfjson.SchemaAttribute) (map[string]cty.Value, error) {
attributesMap := make(map[string]cty.Value)
for attrName, attr := range attrs {
marshal, err := json.Marshal(attr)
if err != nil {
return nil, fmt.Errorf("cannot marshal attribute schema for %s: %+v", attrName, err)
}
attrObj, err := stdlib.JSONDecode(cty.StringVal(string(marshal)))
if err != nil {
return nil, fmt.Errorf("cannot decode attribute schema for %s: %+v", attrName, err)
}
attributesMap[attrName] = attrObj
}
return attributesMap, nil
}