Open FrancoisClement opened 7 years ago
I can understand the request, but it's more complicated that it seems.
For one thing, query parameters (by definition and implementation) are order-independent. In other words, a request for /my/resource?one=a&two=b
is semantically equivalent to a request for /my/resource?two=b&one=a
.
The other thing that needs to be considered is that query parameters are defined by more than just method parameters. You'd need to take into account the field-based query parameters, setter-based query parameters, and custom enunciate-specific query parameters. And that's further complicated by the field-based, setter-based, and enunciate-specific query parameters that are defined in each superclass.
So it's easy to say "preserve my query parameter order," but a practical solution would need to take into account the other cases. And I still can't think of something better than just lexically sorting them, but I'm open to suggestions if you can provide any.
Thanks for your Quick reply.
I agree that query parameters are order-independent. But in documentation, it would be convenient to sort parameters in a business logic for better comprehension.
I think you could have an annotation to give order (the same way you have @xmltype(propOrder = {"one", "two", "three", "four"})
for sorting json response.
Regards.
This enhancement is currently seeking a sponsor. If anybody is willing to sponsor the work, reach out to me and I'd be happy to pick it up.
Hi,
I can't find a way to preserve my @QueryParam sort order.
For example :
API
BeanParam :
I would like my @QueryParam appear in documentation in the same order : one, two, three, four. But whatever I try, they appear on alphabetical order :