Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
klaus7 opened this issue Dec 20, 2023 · 1 comment
Open

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

klaus7 opened this issue Dec 20, 2023 · 1 comment

Comments

@klaus7
Copy link

klaus7 commented Dec 20, 2023

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
Copy link
Author

klaus7 commented Feb 1, 2024

Found a workaround:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant