We now support PATCH request with application/json-patch+json [0] and application/merge-patch+json media types. The support is based on some customized usage of the FGE JSON Patch library [2]. As we need to apply the patch to an existing object, we need translate the JSON Patch remove operation into a replace operation setting the value to null so that out entity processing component registers the request for removal. Same applies to requests for merge-patch+json. From an implementation point of view the handling of the media type has moved from the controller into PersistentEntityResourceHandlerMethodArgumentResolver and its delegates, n particular JsonPatchHandler. The application of the changes to the existing domain object is handled in the newly introduced DomainObjectReader. Related ticket: DATAREST-345. [0] http://tools.ietf.org/html/rfc6902 [1] http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch [2] https://github.com/fge/json-patch
116 lines
2.9 KiB
XML
116 lines
2.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<artifactId>spring-data-rest-webmvc</artifactId>
|
|
|
|
<name>Spring Data REST - WebMVC</name>
|
|
<description>Spring Data REST - WebMVC</description>
|
|
|
|
<parent>
|
|
<groupId>org.springframework.data</groupId>
|
|
<artifactId>spring-data-rest-parent</artifactId>
|
|
<version>2.2.0.BUILD-SNAPSHOT</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<properties>
|
|
<jsonpath>0.8.1</jsonpath>
|
|
</properties>
|
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
<groupId>${project.groupId}</groupId>
|
|
<artifactId>spring-data-rest-core</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.springframework</groupId>
|
|
<artifactId>spring-webmvc</artifactId>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>javax.servlet</groupId>
|
|
<artifactId>javax.servlet-api</artifactId>
|
|
<version>3.0.1</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
|
|
<!-- Optional store specifics -->
|
|
|
|
<dependency>
|
|
<groupId>org.springframework</groupId>
|
|
<artifactId>spring-orm</artifactId>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.hibernate.javax.persistence</groupId>
|
|
<artifactId>hibernate-jpa-2.0-api</artifactId>
|
|
<version>1.0.1.Final</version>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- Jackson -->
|
|
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.core</groupId>
|
|
<artifactId>jackson-databind</artifactId>
|
|
<version>${jackson}</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.core</groupId>
|
|
<artifactId>jackson-annotations</artifactId>
|
|
<version>${jackson}</version>
|
|
</dependency>
|
|
|
|
<!-- Jackson Hibernate -->
|
|
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
<artifactId>jackson-datatype-hibernate4</artifactId>
|
|
<version>${jackson}</version>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.hibernate</groupId>
|
|
<artifactId>hibernate-core</artifactId>
|
|
<version>${hibernate.version}</version>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- Jackson JodaTime -->
|
|
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
<artifactId>jackson-datatype-joda</artifactId>
|
|
<version>${jackson}</version>
|
|
<optional>true</optional>
|
|
</dependency>
|
|
|
|
<!-- JSON patch -->
|
|
|
|
<dependency>
|
|
<groupId>com.github.fge</groupId>
|
|
<artifactId>json-patch</artifactId>
|
|
<version>1.7</version>
|
|
</dependency>
|
|
|
|
<!-- Test dependencies -->
|
|
|
|
<dependency>
|
|
<groupId>com.jayway.jsonpath</groupId>
|
|
<artifactId>json-path</artifactId>
|
|
<version>${jsonpath}</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
|
|
</dependencies>
|
|
|
|
</project>
|