smallrye-graphql icon indicating copy to clipboard operation
smallrye-graphql copied to clipboard

Problems with Generics in quarkus 3

Open robp94 opened this issue 1 year ago • 3 comments

Currently migrating to quarkus 3. I am getting some errors, the same code works with quarkus 2.

public record InsertLangEntryGQLJ<T>(String lang, T record) {
    @JsonbCreator
    public InsertLangEntryGQLJ {
    }
}

public record InsertTechnicalLocationInputJ(@Id String id,
                                            List<@NonNull InsertLangEntryGQLJ<@NonNull InsertTechnicalLocationRecordGQLJ>> multiLangRecords) {

    @JsonbCreator
    public InsertTechnicalLocationInputJ {
    }
}

Yasson fails here in org.eclipse.yasson.internal.ReflectionUtils#getRawType image

In the reproducer there is a Kotlin and a Java version, both fail for quarkus 3 and work for quarkus 2. When switching between quarkus version, you need to change javax vs jakarta, and you should change the koltin version (both used version are in the pom as comment).

Mutation to trigger the error.

mutation testJava{
  testJava(input:{
    id: 0,
    multiLangRecords: {
      lang: "",
      record: {
        description: ""
      }
    },  
  })}

code-with-quarkus3-graphql-generics.zip

robp94 avatar May 02 '23 10:05 robp94