vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client
MIT License
1.14k stars 237 forks source link

Kotlin boolean with 'is' prefix -> field name is wrong #1050

Open klaus7 opened 8 months ago

klaus7 commented 8 months ago

If you declare a boolean property with an 'is' prefix like:

    var isPrimaryUser: Boolean? = false

... this is generated:

  primaryUser: boolean | null

Which is not correct and won't work, because the objects from the backend are serialized in an object like

{ 
  isPrimaryUser: false 
}
klaus7 commented 7 months ago

Found a workaround:

@get:JsonProperty("isPrimaryUser")   
var isPrimaryUser: Boolean? = false