2016-08-17 14 views
0

我使用Spring Boot 1.4.0.RELEASE和spring-data-rest-hal-browser,spring-boot-starter-hateoas,spring-boot-starter-data-rest和一些其他依赖项。为什么我通过向根URL发出请求来获取HAL浏览器的引用而不是JSON + HAL响应?

当我打电话

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

我的控制台上,我得到以下回应:

* 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 

但我期望得到一个JSON对象与所有已发现的资源。至少有一个,因为我目前有一个存储库:

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

任何提示?

谢谢 基督教

回答

2

a bug在春季版数据REST的那个春天引导1.4.0用途。它已在最新的Spring Data REST和Spring Boot快照中得到修复。

您可以通过使用Spring Boot 1.4.1.BUILD-SNAPSHOT或使用Spring Boot 1.4.0.RELEASE和覆盖spring-data-releasetrain.version属性以获得值Hopper-BUILD-SNAPSHOT来试用它。在这两种情况下,快照均可从https://repo.spring.io/libs-snapshot获得。

+0

谢谢安迪。 1.4.1.BUILD-SNAPSHOT诀窍... – Chrisposure

相关问题