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

Spring Data Rest Hateos Return Extra Column

Usring SDR. i have an entity, PersonRole, based on a join table. For a report i want the min date between two different columns of the tables joined by the join table. i work on an intranet so her is some pseudo code... select pr, if pr.dateOne <…
user2052618
  • 556
  • 2
  • 7
  • 20
0
votes
1 answer

Using PagedResourcesAssembler from Spring Data Core for HATEOAS link generation

In the Spring Data JPA documentation it explains how to generate links using PagedResourcesAssembler. The documentation makes reference to a toResources() method but as far as I can see that method does not exist. I have successfully generated links…
0
votes
0 answers

How to create HATEOAS Resource Link to remote service method?

The scenario looks like that: eureka server and two other services (spring-boot-apps) are running two micro services (A and B) are registered in eureka server both services provides REST HATEOAS endpoint app 'A' provides a service method 'x' which…
Karol Król
  • 3,320
  • 1
  • 34
  • 37
0
votes
1 answer

How to loop and retrieve value from HATEOAS _link attribute (e.g. retrieve a description)?

tl;dr My code gets an array of javascript/json objects from a Restful GET. How do I write code to loop and retrieve, for display, a description (or any value) from a HATEOAS "_link" attribute? Context I've inherited a small Spring-based project…
user331465
  • 2,984
  • 13
  • 47
  • 77
0
votes
1 answer

Why do we need curies in Spring HATEOAS

I have basic understanding of what Spring's HATEOAS is, and also those basic HETEOAS links, like: _links : { self: { href: "http://myhost/person/1" } } I tried to search online but i can't really get a grasp of what curies is in HATEOAS. I…
hades
  • 4,294
  • 9
  • 46
  • 71
0
votes
1 answer

JPA query on @MappedSuperClass. Fetch details of all the child class?

I am having 3 radio buttons 1.Car, 2.Bike, 3.Both. So if i select car it will fetch all the car details if i select 2 it will only fetch the car details till here i am able to achieve but how to fetch both the Car and bike details if I select…
DirtyMind
  • 2,353
  • 2
  • 22
  • 43
0
votes
1 answer

spring-data-rest generating wrong entity links in proxy setup

I deployed my Spring Boot application behind an Apache powered reverse proxy. This proxy already sets the headers X-Forwarded-Proto and X-Forwarded-Host correctly. However, spring-data-rest generates weird entity and enpoint links. E.g. requesting…
kenda
  • 488
  • 6
  • 16
0
votes
1 answer

Spring REST HATEOAS

I am trying to follow best practices imagine a basic API with /books endpoint. I've the following classes: Book BookRepository (PagingAndSortingRepository but not exported!!) BookController (this is the serving class) BookResource ("representation"…
EralpB
  • 1,621
  • 4
  • 23
  • 36
0
votes
1 answer

_link model - HATEOAS

I have been asked to implement HATEOAS as part of our rest API and this is how the response is defined in Swagger specs _links: [ { rel: string The relationship to the request e.g. self which contains the resource that was requested or…
java_buzz
  • 67
  • 1
  • 6
0
votes
2 answers

Customising json output in spring hateoas

I am building spring (spring boot) based api. Is it possible to remove _embedded keyword from generated by hateoas library json output? I would like to have collection of my items displayed not under the _embedded. I know it breaks the…
AKK
  • 1
  • 1
0
votes
2 answers

Gradle Not Honoring Forced Dependency Version

I am unable to force a version of a dependency using Gradle. My goal is to use version 0.20.0.RELEASE of the Spring HATEOAS library, but despite all my efforts it keeps resolving to 0.19.0.RELEASE. I have attempted a number of strategies, both in…
Dan Forbes
  • 2,734
  • 3
  • 30
  • 60
0
votes
0 answers

Spring Hateoas ControllerLinkBuilder doesn't support composed annotations

The project I'm working on is explicitly using the APPLICATION_JSON_UTF8_VALUE media type. To make it easier for our devs and limit the keystrokes I wanted to created a composed annotation that enforced the media type but allowed for the path to be…
Dan King
  • 1,080
  • 1
  • 11
  • 28
0
votes
1 answer

Pagingandsortingrepositrory in spring data , primary key in the entity is not present in the response

I have declared pagingandSortingRepository for a JPA entity and the response to findall() is below "_embedded" : { "assetDashboardCustomers" : [ { "utilization" : "80", "_links" : { "self" : { "href" :…
Ganesh
  • 1,654
  • 2
  • 19
  • 32
0
votes
1 answer

Using HAL-browser with spring-hateoas WITHOUT spring-data-rest

We're starting a new project, and we're looking into using spring-hateoas / hypermedia. The HAL browser also looks interesting, so we wanted to check it out. However, the HAL browser seems bundled to spring-data-rest, which we don't want to use (for…
runeaen
  • 461
  • 5
  • 22
0
votes
1 answer

How to implement spring-hateoas on a spring boot app that use mybatis instead of jpa

I am trying to implement hypermedia using the spring-hateoas plugin. I don't have JPA hibernate like in this example : https://spring.io/blog/2015/09/15/react-js-and-spring-data-rest-part-2-hypermedia But I do really like the result. The only thing…
Dimitri Kopriwa
  • 13,139
  • 27
  • 98
  • 204