We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The newly introduced resolverArgumentAnnotations configuration (#983) works well in java, but annotations are not applied in kotlin code.
resolverArgumentAnnotations
I believe this is just missing code in the kotlin free marker templates. Consider:
https://github.com/kobylynskyi/graphql-java-codegen/blob/master/src/main/resources/templates/java-lang/operations.ftl#L38
and
https://github.com/kobylynskyi/graphql-java-codegen/blob/master/src/main/resources/templates/kotlin-lang/operations.ftl#L41
The kotlin code should look something like (wrapped for clarity):
fun ${operation.name}( <#list operation.parameters as param> <#-- include annotations --> <#list param.annotations as paramAnnotation> @${paramAnnotation} <#if param.annotations?has_content> </#if> </#list> <#-- /include annotations --> ${param.name}: ${param.type} <#if param_has_next>, </#if> </#list>): ${operation.type}
Generate code using:
{ "resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"], "language": "JAVA" }
The relevant @Argument annotation is present.
@Argument
Replace language with "KOTLIN" and the generated annotation is missing.
"KOTLIN"
Generated code should provide the annotation in both Kotlin and Java.
Generated code provides the annotation in Java but not Kotlin
{ "resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"], "language": "KOTLIN" }
The text was updated successfully, but these errors were encountered:
@jxnu-liguobin can you please take a look? Thanks
Sorry, something went wrong.
Added support for annotations in generated kotlin operations, fixing k…
86ccf6d
…obylynskyi#1002
Added an additional test for kobylynskyi#1002 - multiple annotations
e650281
Added support for annotations in generated kotlin operations #1002 (#…
a0d8244
…1003)
Thanks @msl-at-fcb for working on this. I will include your changes in the upcoming release
6b451dc
msl-at-fcb
No branches or pull requests
Issue Description
The newly introduced
resolverArgumentAnnotations
configuration (#983) works well in java, but annotations are not applied in kotlin code.I believe this is just missing code in the kotlin free marker templates. Consider:
https://github.com/kobylynskyi/graphql-java-codegen/blob/master/src/main/resources/templates/java-lang/operations.ftl#L38
and
https://github.com/kobylynskyi/graphql-java-codegen/blob/master/src/main/resources/templates/kotlin-lang/operations.ftl#L41
The kotlin code should look something like (wrapped for clarity):
Steps to Reproduce
Generate code using:
The relevant
@Argument
annotation is present.Replace language with
"KOTLIN"
and the generated annotation is missing.Expected Result
Generated code should provide the annotation in both Kotlin and Java.
Actual Result
Generated code provides the annotation in Java but not Kotlin
Your Environment and Setup
The text was updated successfully, but these errors were encountered: