Skip to content

SPQR does not work well with Java records with a nondefault constructor #515

Open
@lukas-krecan

Description

@lukas-krecan

See this example The code contains a generic class referenced by a Java record with an additional constructor.

If complied with:

  • Java 17 - it starts but it ignores the annotations on the generic class RangeFilter
  • Java 21, 22 it does not even start complaining about Caused by: io.leangen.graphql.metadata.exceptions.TypeMappingException: Type io.leangen.graphql.samples.dto.FilterInput$RangeFilter is unbounded or missing generic type parameters
  • In Java 23 it starts, I did not check if the generated schema is correct

As a workaround it helps to drop non-default constructor from Java records or to not use records at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions