vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

klaus7 opened this issue · comments

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 
}

Found a workaround:

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