简体   繁体   中英

spring data rest hal browser: how to expose resource descriptions and document

I have looked all over the net, trolled through spring-data-rest source code and tried to decipher how the JS for the hal-browser is trying to retrieve 'title' and 'doc' details for a resource. I have also discovered that there are

@RepositoryRestResource(
        collectionResourceRel = "roles",
        path = "roles",
        itemResourceDescription = @Description("This is a test description")
)

Annotations I can put in the @Repostitory, but it doesn't seem to do anything.

Specifically, if you look at this example, how do I get "title|doc" to fill in"

I filed a ticket with spring and haven't heard back.

From what I can see the HAL Browser expects the link to contain the title property. In the example you linked:

{
  "motd": "Welcome to the OSDI Example Action Platform OSDI API endpoint!!",
  "_links": {
    "osdi:people": {
      "href": "http://api.opensupporter.org/api/v1/people",
      "title": "The collection of people in the system"
    }
  ...
}

The org.springframework.hateoas.Link class does not support that property as of version 0.19.0.RELEASE . No idea about the docs though...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM