Skip to content

Resteasy Reactive doesn't fully recognize the bean param when it's in generic interface #42807

Open

Description

Describe the bug

When I use a generic interface defined for the controller, the @BeanParam doesn't fully recognize the query param defined in the class.

I have 2 models (called filters): PageFilter is the base filter and UserFilter extends it

public abstract class PageFilter {
    @RestQuery
    @DefaultValue(value = "0")
    protected Integer number;
    @RestQuery
    @DefaultValue(value = "20")
    protected Integer size;
    @RestQuery
    private List<String> sort;
}
public class UserFilter extends PageFilter {
    @RestQuery
    private String username;
    @RestQuery
    private String fullName;
}

And I have a generic interface like this

public interface IGetInfoPageController<ID, T extends BaseData<ID>, F extends PageFilter> {

    @GET
    @Path("/list")
    @Produces(MediaType.APPLICATION_JSON)
    default RestResponse<BaseResponse<BasePagingResponse<T>>> getInfoPageWithFilter(@BeanParam @Valid F filter) {
        // some logic code
    }
}

I implement that in the controller:

@Path("/api/user")
@Tag(name = "User Controller")
public class UserController implements IGetInfoPageController<String, UserInfo, UserFilter> {
   //Some method and logic
}

I want a bean param UserFilter containing 5 fields: number, size, sort, username, and fullName. But username and fullName are always null. When I checked OpenAPI UI, it only showed 3 fields in PageFilter

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

Linux 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

java 17.0.8 2023-07-18 LTS Java(TM) SE Runtime Environment Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14) Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 17.0.8+9.1 (build 17.0.8+9-LTS-jvmci-23.0-b14, mixed mode, sharing)

Quarkus version or git rev

3.13.3

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 8.8

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions