Spring Data REST (SDR) is a Spring Data project that aims to make it easy to expose Spring Data repositories as REST services. SDR use Spring HATEOAS internally to create HAL response.
Questions tagged [spring-data-rest]
2228 questions
21
votes
5 answers
How to post a list to Spring Data Rest?
I followed this example, which allows to post a unique Person object. I want a REST service where I can post a collection of Person at once, e.g. a list/any collection named Team with numerous Person objects in just one call.
I mean, my question is…

Jim C
- 3,957
- 25
- 85
- 162
21
votes
4 answers
How to configure Spring HATEOAS behind proxy?
I have Spring Data Rest with Hateoas as my backed. It is behind a proxy.
Backend url: backend.com
Proxy url: proxy.com
When I query proxy url, e.g. http://proxy.com/items/1, I get a response with href links with domain backend.com. I need the domain…

Jan Święcki
- 1,611
- 2
- 16
- 28
21
votes
5 answers
While using Spring Data Rest after migrating an app to Spring Boot, I have observed that entity properties with @Id are no longer marshalled to JSON
This question is related to this SO question (Spring boot @ResponseBody doesn't serialize entity id). I have observed that after migrating an app to Spring Boot and using the spring-boot-starter-data-rest dependency, my entity @Id fields are no…

Patrick Grimard
- 7,033
- 8
- 51
- 68
20
votes
2 answers
Spring Data REST in plain JSON (not HAL format)
How exactly should Spring Data Rest be configured to return plain JSON instead of HAL (JSON with Hypermedia like links)
Related
Spring returns Resource in pure JSON not in HAL Format when including spring data rest
Spring Data Rest -Disable self…

Paul Verest
- 60,022
- 51
- 208
- 332
20
votes
4 answers
PUT and POST fail on unknown properties Spring different behavior
I am writing Spring Boot application using Spring Data Rest repositories and I want to deny access to resource if request body contains JSON that has unknown properties. Definition of simplified entity and repository:
@Entity
public class Person{
…

Infinity
- 3,431
- 3
- 25
- 46
20
votes
3 answers
Spring Data Rest: Security based projection
I am using the current version of Spring Data Rest and Spring Data JPA and have following entity:
public class User {
@Id
@GeneratedValue
private Long id;
private String name;
private String password;
private String email;
…

Plechi
- 358
- 2
- 10
20
votes
4 answers
Spring-Data-Rest Validator
I have been trying to add spring validators to a spring-data-rest project.
I followed along and setup the "getting started" application via this link: http://spring.io/guides/gs/accessing-data-rest/
...and now I am trying to add a custom…

Robert Greathouse
- 1,024
- 1
- 10
- 18
20
votes
2 answers
Selectively expand associations in Spring Data Rest response
I have a standard Spring data JPA and Spring data Rest setup which, correctly, returns associations as links to the correct resources.
{
"id": 1,
"version": 2,
"date": "2011-11-22",
"description": "XPTO",
"_links": {
…

Luis Santos
- 202
- 1
- 2
- 6
19
votes
5 answers
The following method did not exist: 'org.springframework.plugin.core.PluginRegistry org.springframework.plugin.core.PluginRegistry.of(java.util.List)'
pom.xml
org.springframework.boot
spring-boot-starter-data-jpa
…

Muhammed Ozdogan
- 5,341
- 8
- 32
- 53
19
votes
1 answer
How to work with DTO in Spring Data REST projects?
Spring Data REST automates exposing only domain object. But most often we have to deal with Data Transfer Objects. So how to do this in SDR way?

Cepr0
- 28,144
- 8
- 75
- 101
19
votes
7 answers
Resolving entity URI in custom controller (Spring HATEOAS)
I have a project based on spring-data-rest and also it has some custom endpoints.
For sending POST data I'm using json like
{
"action": "REMOVE",
"customer": "http://localhost:8080/api/rest/customers/7"
}
That is fine for spring-data-rest, but…

Serg
- 938
- 8
- 14
19
votes
2 answers
Accepting a Spring Data REST URI in custom controller
I have a Spring Data Rest webmvc application that I'd like to add some custom functionality to for batch operations.
I've created a controller, and blended it into the uri namespace, but I'd like for it to be able to accept URI's like the custom…

CollinD
- 7,304
- 2
- 22
- 45
19
votes
5 answers
Spring Data Query Method with Optional @Param
Is it possible to allow query method @Params to be optional, specifically in the case of Spring Data REST?
For example, I'd like to bind a very similar search to the same resource path. To do this now, I would need something like the…

bvulaj
- 5,023
- 5
- 31
- 45
19
votes
3 answers
Handle spring-data-rest application events within the transaction
I need to publish notification events to external systems over JMS, when data is updated. Id like this to be done within the same transaction as the objects are committed to the database to ensure integrity.
The ApplicationLifecycle events that…

dan carter
- 4,158
- 1
- 33
- 34
19
votes
2 answers
Spring Data REST - POST new entity with relationships
Relates to: Spring Data Rest version 2.0.2
I'm trying to POST an entity (Address) with a @ManyToOne (instead of @OneToOne as in example) relationship to Person as explained in: Embedded Entity references in complex object graphs but I get a Jackson…

pakman
- 1,676
- 3
- 23
- 41