Closed
Description
Say we have a graphql schema as follows:
Type Somei8n {
aa: String,
ab: String,
ae: String,
# and so on...
as: String,
}
The generator generates a .kt
file:
data class Somei8n (
val aa: String? = null,
val ab: String? = null,
//and so on...
val as: String? = null, //compilation error due to the reserved keyword as not being wrapped in backticks
)
Types with fields matching to reserved keywords should be wrapped with backticks:
data class Somei8n (
val `as`: String? = null, //works and retains field name
)
Applies at least to is
and as
keywords. Exhaustive list of Kotlin keywords can be found at: kotlin docs
Metadata
Metadata
Assignees
Labels
No labels