spring-data-commons icon indicating copy to clipboard operation
spring-data-commons copied to clipboard

URI template with '*' for parameters that support multiple values [DATACMNS-780]

Open spring-projects-issues opened this issue 10 years ago • 2 comments

Mirco Andreon opened DATACMNS-780 and commented

Hello, I created a search service like this for my resource:

List<Booking> findByStatusIn(@Param("status") Collection<BookingStatus> status);

Hence it allows multiple values for parameter "status". When I invoke http://localhost:8080/myapp/rest/myresources I get:

{
  "_links" : {
    "findByStatusIn" : {
      "href" : "http://localhost:8080/myapp/rest/myresources/search/findByStatusIn{?status}",
      "templated" : true
    }
  }
}

This seems incorrect, since the "href" should be "http://localhost:8080/myapp/rest/myresources/search/findByStatusIn{?status*}, that is include an asterisk after the parameter name. This comes from RFC 6570 as stated here https://github.com/basti1302/traverson/issues/41


Affects: 1.9.3 (Evans SR3), 1.10.2 (Fowler SR2), 1.11 GA (Gosling)

Reference URL: https://github.com/basti1302/traverson/issues/41

1 votes, 3 watchers

spring-projects-issues avatar Apr 07 '15 06:04 spring-projects-issues

Oliver Drotbohm commented

Needs to be fixed in Spring HATEOAS first with a follow up fix in Spring Data Commons

spring-projects-issues avatar Nov 04 '15 13:11 spring-projects-issues

Any update on this issue? I am struggling to figure out how to specify multiple sort params with spring data's Traverson Java client. It looks like it's currently not possible to do this.

rmorrise avatar Apr 30 '21 18:04 rmorrise