You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to create something similar to this:
@Getter
@Setter
public class UserFilter {
@RestQuery private String name;
@BeanParam private AddressFilter address1;
@BeanParam private AddressFilter address2;
@Getter
@Setter
public static class AddressFilter {
@RestQuery private String province;
@RestQuery private String city;
@RestQuery private String area;
}
}
@Path("user")
public class UserEndpoint
{
@GET
@Path("/list")
public List<ProductDto> listWithQueryParams(
@Valid @BeanParam UserFilter filter
{
return ...;
}
}
And this cannot work, since both address1 and address2 bind to the same queryParameters; province, city, area.
I would like to bind query parameters for addresses to something like address1.province, address2.city...
I know that there are several ways to implement the desired logic. Each with its own drawbacks.
This works exactly how I would like it to work. But... Its ugly as hell :)
Custom ParamConverterProvider
Pass object to url as jsons, create custom ParamConverterProvider.
Thats a very bad and ugly idea, even the swaggerUi do not support sending objects as queryParams.
https://github.com/swagger-api/swagger-ui/issues/7696
This is by no means a bug, its more like a feature request.
The documentation states
So this cannot work.
I'm wondering if it could also be supported with quarkus in some way... Maybe another annotation, similar to @Separator, to notate the prefix of nested objects parameters?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have been trying to create something similar to this:
And this cannot work, since both address1 and address2 bind to the same queryParameters; province, city, area.
I would like to bind query parameters for addresses to something like
address1.province
,address2.city
...I know that there are several ways to implement the desired logic. Each with its own drawbacks.
In this case, you have to parse query parameters to POJO mannualy. You also lose openapi spec for available query params.
This works exactly how I would like it to work. But... Its ugly as hell :)
This is by no means a bug, its more like a feature request.

The documentation states
So this cannot work.
With spring, this is supported out of the box.
https://www.taogenjia.com/2022/08/17/How-to-Pass-Nested-Object-to-Spring-MVC-Controller/
I'm wondering if it could also be supported with quarkus in some way... Maybe another annotation, similar to @Separator, to notate the prefix of nested objects parameters?
Beta Was this translation helpful? Give feedback.
All reactions