0
votes

I am using Spring Boot 1.4.0.RELEASE with spring-data-rest-hal-browser, spring-boot-starter-hateoas, spring-boot-starter-data-rest and a couple of other dependencies.

When I call

curl -H "Authorization: Basic YWRtaW46YWRtaW4xMjM=" -G http://localhost:8080/api/v1 -v

on my console, I get the following response:

* Adding handle: conn: 0x66a9e0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x66a9e0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /api/v1 HTTP/1.1
> User-Agent: curl/7.33.0
> Host: localhost:8080
> Accept: */*
> Authorization: Basic YWRtaW46YWRtaW4xMjM=
>
< HTTP/1.1 302
< Set-Cookie: JSESSIONID=3DC642CBC288E944471DF289B11FBED4;path=/;HttpOnly
< X-Application-Context: application:dev
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< Cache-Control: no-cache, no-store, max-age=0, must-revalidate
< Pragma: no-cache
< Expires: 0
< Location: http://localhost:8080/api/v1/browser/index.html#/api/v1
< Content-Language: de-DE
< Content-Length: 0
< Date: Wed, 17 Aug 2016 06:11:47 GMT

But I was expecting to get a json object with all discovered resources. At least one, because I have currently one repository:

@RepositoryRestResource(path = "billing-services", collectionResourceRel = "billing-services", collectionResourceDescription = @Description("Mandantendaten"))
    public interface BillingServiceRepository extends CrudRepository<BillingService, Long> {
}

Any hints?

Thank you, Christian

1

1 Answers

2
votes

There's a bug in the version of Spring Data REST that Spring Boot 1.4.0 uses. It's already been fixed in the latest Spring Data REST and Spring Boot snapshots.

You can try it out either by using Spring Boot 1.4.1.BUILD-SNAPSHOT or by using Spring Boot 1.4.0.RELEASE and overriding the spring-data-releasetrain.version property to have the value Hopper-BUILD-SNAPSHOT. In both cases the snapshots are available from https://repo.spring.io/libs-snapshot.