spring-projects / spring-projects/spring-data-rest
Some documentation showing how to exposing a resource with "title name/index" [DATAREST-800]
@odrotbohm is already working on this.
Since Dec 31, 2020.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Christian Bongiorno opened DATAREST-800 and commented
I am using spring-data-rest + hal browser by importing the dependency.
It seems to work well enough but there doesn't seem to ba a way to provide details to:
"title | name/index | docs"
In the links section of the browser. I assume these can be discovered resources but quite a bit of sniffing around isn't finding it
Having spent more time on this I am flagging it as a bug because the the controller used to provide the HAL link data doesn't even produce what is needed:
GET /hal HTTP/1.1
Host: localhost:9090
Connection: keep-alive
Cache-Control: max-age=0
Accept: application/hal+json, application/json, */*; q=0.01
X-Requested-With: XMLHttpRequest
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36
Referer: http://localhost:9090/hal/browser/index.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Date: Thu, 14 Apr 2016 20:11:53 GMT
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Application-Context: application
Content-Type: application/hal+json;charset=UTF-8
Transfer-Encoding: chunked
Date: Thu, 14 Apr 2016 20:11:53 GMT
596
{
"_links" : {
"schedules" : {
"href" : "http://localhost:9090/hal/schedules{?page,size,sort}",
"templated" : true
},
"certifications" : {
"href" : "http://localhost:9090/hal/certifications{?page,size,sort}",
"templated" : true
},
"organizations" : {
"href" : "http://localhost:9090/hal/organizations{?page,size,sort}",
"templated" : true
}
}
}
I am looking at RepositoryController.listRepositories() and following through this code and there is no property at all being exposed for "title" or "name" or "docs". I imagine "Docs" could be exposed as a org.springframework.data.rest.core.annotation.Description on the repository.
See: org.springframework.hateoas.ResourceSupport
Maybe it's not a bug? Maybe it's a feature request. I see your name on the code so I will let you decide
Affects: 2.4.2 (Gosling SR2)
Attachments:
- halbrowser.png (175.42 kB)
Issue Links:
- DATAREST-999 Support multiple properties-files in resourceDescriptionMessageSourceAccessor
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.