DATAREST-348 - Support for json-patch+json and merge-patch+json media types.
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
This commit is contained in:
@@ -92,7 +92,15 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user