Skip to content

Version 5.7.0 seems to break customAnnotationsMapping for fields in input types #1055

@dsilva

Description

@dsilva

Issue Description

Version 5.7.0 is omitting the annotations configured in customAnnotationsMapping for fields in input types.

Steps to Reproduce

Repro at https://github.com/dsilva/repro-graphql-java-codegen-missing-annotations

  1. Clone the repo
  2. Run ./gradlew graphqlCodegen
  3. Look at build/generated/ReproInput.java

Expected Result

The output up to version 5.6.0 was

    @javax.validation.constraints.NotNull
    @com.fasterxml.jackson.annotation.JsonProperty("reproField")
    private java.util.List<String> reproField;

Actual Result

The output with version 5.7.0 of the gradle plugin includes this:

    @javax.validation.constraints.NotNull
    private java.util.List<String> reproField;

Your Environment and Setup

  • graphql-java-codegen version: 5.7.0
  • Build tool: Gradle
  • Mapping Config: E.g.:
tasks.named<io.github.kobylynskyi.graphql.codegen.gradle.GraphQLCodegenGradleTask>("graphqlCodegen").configure {
  graphqlSchemaPaths = listOf(
    "$projectDir/schema.graphqls"
  )
  outputDir = File("$buildDir/generated")

  customAnnotationsMapping = mutableMapOf(
    Pair("ReproInput.reproField", listOf("""@com.fasterxml.jackson.annotation.JsonProperty("reproField")"""))
  )

  generatedAnnotation = "javax.annotation.Generated"
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions