Don't mark provider token string types with json attribute in C#
Don't mark provider token string types with json attribute in C#
@@ -358,9 +358,17 @@ func (pt *plainType) genInputProperty(w io.Writer, prop *schema.Property, indent
if prop.IsRequired {
attributeArgs = ", required: true"
}
- if pt.res != nil && pt.res.IsProvider && prop.Type != schema.StringType {
+ if pt.res != nil && pt.res.IsProvider {
+ json := true
+ if prop.Type == schema.StringType {
+ json = false
+ } else if t, ok := prop.Type.(*schema.TokenType); ok && t.UnderlyingType == schema.StringType {
+ json = false
+ }
+ if json {
attributeArgs += ", json: true"
}
+ }
// Next generate the input property itself. The way this is generated depends on the type of the property:
// complex types like lists and maps need a backing field.
