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):
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}
Steps to Reproduce
Generate code using:
{
"resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"],
"language": "JAVA"
}
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
- graphql-java-codegen version: 5.5.0
- Build tool: Maven
- Mapping Config:
{
"resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"],
"language": "KOTLIN"
}
Issue Description
The newly introduced
resolverArgumentAnnotationsconfiguration (#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:
{ "resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"], "language": "JAVA" }The relevant
@Argumentannotation 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
{ "resolverArgumentAnnotations": ["org.springframework.graphql.data.method.annotation.Argument"], "language": "KOTLIN" }