REST: support a @QueryParam that is a generic type that extends enum in an abstract class. #33816
Open
Description
opened on Jun 4, 2023
Description
Given:
@Path("demo")
public abstract class AbstractDemoResource<DataType_ extends Enum<DataType_>, Solution_> {
...
@GET
@Path("data")
public abstract Solution_ generate(@QueryParam("type") DataType_ demoDataType);
}
public class TimeTableDemoResource extends AbstractDemoResource<TimeTableDemoResource.DemoDataType, TimeTable> {
public enum DemoDataType {
SMALL,
LARGE
}
...
}
Actual behavior:
RESTEASY003875: Unable to find a constructor that takes a String param or a valueOf() or fromString() method for jakarta.ws.rs.QueryParam("type") on public abstract java.lang.Object org.acme.schooltimetabling.service.AbstractDemoResource.generate(java.lang.Enum) for basetype: java.lang.Enum
Expected behavior:
Only resolve the query param type for the concrete class, which does know it's DemoDataType, not just Enum.
Implementation ideas
No response
Activity