Questions tagged [spring-hateoas]

Spring HATEOAS provides some APIs to ease creating REST representations that follow the HATEOAS principle when working with Spring and especially Spring MVC. The core problem it tries to address is link creation and representation assembly.

HATEOAS (Hypertext As The Engine of Application State)

Resources

Clarification by Roy Fielding that HATEOAS is required for REST.

Building REST services with Spring explains what HATEOAS is, why it is required for REST and how to implement it using Spring MVC and Spring HATEOAS.

779 questions
0
votes
1 answer

Spring can not register spring hateoas resource assembler

I am using spring hateoas in spring and got the problem is spring could not instance hateoas resource assembler , here is my snippet code: UserHateoasResourceAssembler.java: @Service public class UserHateoasResourceAssembler extends…
Duy Chung
  • 122
  • 7
0
votes
2 answers

Spring Hateoas Deserialize Links in Payload to actual Entities

I have some controller method like: @RequestMapping(value = "/person", method = RequestMethod.POST) public ResponseEntity create(@RequestBody Person person) { personRepository.save(person); return new ResponseEntity<>(HttpStatus.OK); } The…
Benny
  • 1,435
  • 1
  • 15
  • 33
0
votes
1 answer

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…
Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76
0
votes
0 answers

IllegalArgumentException when using ResourceAssemblerSupport and PathVariables in Spring-Hateoas

I'm on my way to create my first RESTful API with Spring-Hateoas and Spring-Boot. So far everything looks quite promising, but when I try to create resources within a class which extends ResourceAssemblerSupport by using the toResource() method ( by…
Robert Schröder
  • 169
  • 2
  • 11
0
votes
0 answers

How to use Spring Hateoas properly with custom page?

Consider this implementation that uses Spring HATEOAS. @Controller class PersonController { @Autowired PersonRepository repository; @RequestMapping(value = "/persons", method = RequestMethod.GET) HttpEntity>…
Alessandro C
  • 3,310
  • 9
  • 46
  • 82
0
votes
1 answer

How to add @RepositoryRestController methods to API listing?

I have a controller that looks something like this: @RepositoryRestController public class PersonOmnisearchController { @Autowired private PersonRepository personRepository; @ResponseBody @RequestMapping(value =…
Andy
  • 8,749
  • 5
  • 34
  • 59
0
votes
0 answers

Polymer consume HAL+JSON restful api

I have a Spring HATEOAS restful api to provide datas for my polymer front-end. Data is received like this: GET /api/tips/news : [ { "id" : 68, "content" : "example tip", "score" : 1, "creationDate" : 1456257119018, "links" : [ { …
Supamiu
  • 8,501
  • 7
  • 42
  • 76
0
votes
2 answers

Spring-hateoas client not compatible with spring-boot-data-rest?

To try to understand the spring ecosystem, I'm building some toy projects on varios parts. I've got a spring-boot-data-rest service working as expected (code here) and I am building a spring-boot and spring-hateoas client to access it (code…
afaulconbridge
  • 1,107
  • 9
  • 21
0
votes
1 answer

Why does requesting JSONAPI metadata from a Spring Data Rest repository return a recursive result in some cases?

I have a simple Spring Boot/Spring Data Rest test application with a single entity "Contact" and a single CRUDRepository. There is no other code. When the database is empty, requesting the api+json metadata on /contact works properly: $ curl -s…
0
votes
1 answer

Spring HATEOAS Link with Matrix Variable Not Working

I am trying to generate and add a link to a RESTful resource from a Spring MVC controller. Our API requires the use of HTTP matrix variables. Unfortunately, the self link generated is missing the matrix variable from the…
0
votes
1 answer

What's the correct way to present paged resources with HAL?

This sounds like a rookie question, but I'm wondering what's the best way to present paged resources with HAL format? Right now I'm using Spring HATEOAS API to convert Page object into resource PagedResourcesAssembler#toResource(Page,…
Derek
  • 1,085
  • 2
  • 20
  • 36
0
votes
1 answer

Generate links for collection resources for a specific single resource

I wrote a custom controller to handle a GET http://localhost:54000/api/v1/portfolios/{id}/evaluate request. @RequestMapping(value = "/portfolios/{id}/evaluate", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public…
Sydney
  • 11,964
  • 19
  • 90
  • 142
0
votes
2 answers

Spring Resource Assembler throwing NoSuchBeanDefinitionException

I am using ResourceAssemblerSupport from spring-hateoas in a spring boot Application I have created the assembler like below: public class MemberResourceAssembler extends ResourceAssemblerSupport{ public…
Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107
0
votes
1 answer

How to create Exception with HttpStatus and send it using Resource of Spring-Hateoas?

I am using Spring-Boot 1.2.7 for developing Spring-Hateoas application with Spring-Data-JPA. I have developed controller class with methods which returns Resource. I want to create Exception with HttpStatus and use it in controller class for GET,…
0
votes
1 answer

spring-hateoas, How to set place holder value when building hypermedia link using onMethod

I am doing a restful application.I have been trying to build a hypermedia link for a method which has pathvariable teacherId as shown in my code below. I used methodOn to build a link for getAllToturialByTeacher method, for example,…
Khaino
  • 3,774
  • 1
  • 27
  • 36