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
0 answers

HATEOAS Links on Spring Framework @pathvariable Map argument fails

I am writing a ReST API using Spring-mvc and Spring hateoas framework. I am trying to create a 'self' Link to a method that has @pathvariable Map as parameter. I am tying to allow multiple pathvariables (and it may grow in future) for the method and…
Ashutosh
  • 15
  • 7
0
votes
1 answer

how to map spring-data-rest JSON response with its object using RestTEmplate

I am having the spring-data-rest application which was exposed with REST APIs. I am using this API to construct web applications. But I am unable to convert this API response into the POJO for ease of use. I am having the response as follows { …
SST
  • 2,054
  • 5
  • 35
  • 65
0
votes
1 answer

Missing links within Spring Data Rest Response using RestTemplate

When I make a call to a Spring Data Rest Endpoint I am expecting to see the self links and related links within each object. None of the links appear. RestTemplate Setup: @HystrixCommand(fallbackMethod =…
code
  • 4,073
  • 3
  • 27
  • 47
0
votes
0 answers

Are there any hidden consequences of disabling isGetter serialization with Spring Data REST

I want jackson to stop serializing fields that aren't fields, for example isNew(), which is just a method. So I've added this. @Configuration class JacksonConfig extends RepositoryRestConfigurerAdapter { @Override public void…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
0
votes
1 answer

Spring Data Rest: ResourceProcessor configuration is not working properly

I have a strange behaviour with a Spring Data Rest implementation (version 2.5.2.RELEASE). I'm trying to register a @Bean of ResourceProcessor>, but there is something strange. I'm trying with two kinds of solutions: 1) Declaring…
Alessandro C
  • 3,310
  • 9
  • 46
  • 82
0
votes
0 answers

How to assemble (and re-use) embedded objects in resource classes?

I have a project where domain classes and REST resources are split up. My domain model contains classes like Hotel, Customer, Country, Continent. Both the Hotel and Customer model have a reference to the Country and Country itself has a reference to…
Marcel Overdijk
  • 11,041
  • 17
  • 71
  • 110
0
votes
0 answers

HAL/HATEOS (Hypertext Application Language) linking and unlinking Resources

I have some questions regarging HAL and the expected behaviour for linking and unlinking resources. I can't find a guideline or specification for the following questions. I try to make a simple example, hoping this help more people (it's a matter of…
Francesco
  • 315
  • 1
  • 3
  • 13
0
votes
0 answers

Spring HATEOAS - Building a Robust and Scalable Solution

Let's consider that I have a REST controller with 3 services. I have the following code in place to add links to each other: @RestController public class ServiceController { @RequestMapping("/service1") public HttpEntity service1()…
user6448130
0
votes
1 answer

Spring HATEOAS/Jackson with resources and resource assembler

I got a Jackson error because of a nested loop in a bidirectional relationship of two of my JPA entities (Task and Job). I started researching and partially managed to solve this using the @JsonManagedReference and @JsonBackReference annotations,…
Manuel Páez
  • 121
  • 1
  • 4
  • 13
0
votes
0 answers

Implementing ACL to Related Resources

I'm building a rest API with Spring Boot, Article entities have a status property of PUBLISHED or DRAFT. Drafts are restricted and only authenticated users can access them. With spring-security-data and spring-boot-starter-security I can use @Query…
John Giotta
  • 16,432
  • 7
  • 52
  • 82
0
votes
1 answer

Enhanced Spring Data Rest delivers empty relations

in my current implementation using Spring-Boot, -HATEOAS, -Rest-Data I'm trying to spare some further rest calls and enhance my rest resource for credits to also deliver relations of a credit (see below account as ManyToOne and…
KLHauser
  • 856
  • 5
  • 11
0
votes
1 answer

How to get self links of embeddedItems from Resources from Spring Data Rest and FeignClient

I have an application where I am using Spring Data Rest to expose my entities in one service, and then use FeignClient from another service to access and update those resources. In examples I've seen POSTing a @OneToMany sub-resource association in…
0
votes
2 answers

How to Extend PagedResourceAssembler

In a Spring-Web RestController we use PagedResources to create ResponseEntities. We have a RequestMethod that will trigger a background search for Elements in a 5km radius, if theres no result in 10km, 20km, until we find any Element. Since we now…
Micha
  • 1
0
votes
1 answer

Embedding a link using Spring HATEOAS

I have link accessible data in my JSON files now. I have Account.class (Account.java, resource, assembler, controller, embeddable etc..) and same for Post.class. However, I would like to embed the author of the post in the database record for that…
BananaBackend
  • 95
  • 1
  • 1
  • 13
0
votes
1 answer

How to simply enable HAL+JSON object mapping with Spring Restemplate

I have been pulling my hair out trying to figure out how to simply enable this sort of functionality in my client in response to a HAL+JSON request. If I have the specific resource I can get the properties to bind but really would like the hrefs in…
Christian Bongiorno
  • 5,150
  • 3
  • 38
  • 76