You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _ is adding by KotlinPoet which does so because value can be a keyword depending on its usage.
If you want backtick instead, you can use escapeKotlinKeywords = true in the kotlin {} block like so
Since it isn't a keyword in this scenario, escaping doesn't seem like the correct behavior to me (and the conventions plugin here won't let me configure wire as far as I can tell, no one internally seems to be using escapeKotlinKeywords).
That said, this issue is in the KotlinPoet project, not Wire.
Context
I have a simple proto file that is essentially representing a map with a
name
andvalue
field.I expect the generated Kotlin code to look something like
Actual
The generated Kotlin code is generated with an underscore appended to the end of the
value
property name.Expected
I expect
value
to not contain an underscore since it is not a keyword as a property name.The text was updated successfully, but these errors were encountered: