Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
When two or more type arguments are identical, the parser throws an exception indicating that the number of items in the schema is different from the number of type parameters: java.lang.IllegalStateException: Number of parameters mismatch for Root(ScanResult)/...
This happens because, when adding child nodes, PluginExecutor doesn't enqueue identical paths, and the path corresponding to a type argument has no information about its position, so they are identical if the type is the same.
Describe the bug
When two or more type arguments are identical, the parser throws an exception indicating that the number of items in the schema is different from the number of type parameters:
java.lang.IllegalStateException: Number of parameters mismatch for Root(ScanResult)/...
This happens because, when adding child nodes,
PluginExecutor
doesn't enqueue identical paths, and the path corresponding to a type argument has no information about its position, so they are identical if the type is the same.See https://github.com/vaadin/hilla/blob/f88c7e1546cea27a17462aa420de781d6d454d3d/packages/java/parser-jvm-core/src/main/java/com/vaadin/hilla/parser/core/PluginExecutor.java#L42-L44
Expected-behavior
TypeScript is generated correctly.
To make this happen, the path for a type argument needs to contain information about its position.
Reproduction
Consider this endpoint:
System Info
Hilla 24.5.0 ... 24.6.0.alpha1