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

Is generateInterfaces not supported for kotlin ? #200

Closed
lorefnon opened this issue Jul 31, 2021 · 4 comments
Closed

Is generateInterfaces not supported for kotlin ? #200

lorefnon opened this issue Jul 31, 2021 · 4 comments

Comments

@lorefnon
Copy link

When I select generateInterfaces as described in this section and the language is set as kotlin, nothing is generated. But on switching to java, I can see all the interfaces getting generated correctly.

@srinivasankavitha
Copy link
Contributor

srinivasankavitha commented Jul 31, 2021 via email

@paulbakker
Copy link
Collaborator

It should just generate Java classes for the client API when in a Kotlin project. Is that not what you're seeing?

We moved away from generating Kotlin specific client API classes because there was no benefit to it compared to generating Java classes. But it should still generate those Java classes obviously.

@lorefnon
Copy link
Author

lorefnon commented Aug 3, 2021

I am not generating client api. This is about generating interfaces instead of data classes or pojos for types defined in the schema.

Using java interfaces in kotlin is a bit of an inconvenience (though not a huge one) because kotlin won't allow overriding of getters in java interfaces by properties in kotlin class (https://youtrack.jetbrains.com/issue/KT-6653). So one needs to define getters with backing properties in kotlin impl.

@paulbakker
Copy link
Collaborator

Sorry, I completely misread your original question.

The generateInterfaces was only implemented for Java. It seemed to make more sense there.
That doesn't mean it wouldn't work for Kotlin, but realistically we're probably not going to prioritize adding it.
I'm closing this issue/question, but if anyone would provide a PR for this we would definitely consider it.

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

3 participants