Commit Graph

1347 Commits

Author SHA1 Message Date
Oliver Gierke
ca9d7f7b1d DATAREST-977 - Fixed reading of complex enums on collection expansion for PATCH.
When merging collections on PATCH we now don't use the first collection item's type for all elements but inspect the values for each existing element found. When it comes to appending elements to the collection, wen now just stick to the declared component type as type hint for reading the provided value.
2017-01-24 16:15:15 +01:00
Oliver Gierke
fe1c4b1e1c DATAREST-957 - Improved PUT handling for transient properties not backed by a field.
When copying the transient properties of an aggregate, we now try field based access first and fall back to accessor based copying in case both a setter and getter are exposed on the type.

Previously we always expected a field to be present which doesn't necessarily has to be the case.

Related ticket: DATAREST-986.
2017-01-24 13:22:04 +01:00
Oliver Gierke
08f012d4aa DATAREST-965 - Switched to property based application of PUT requests.
Jacksons ObjectMapper.readerForUpdate(…) unfortunately doesn't handle nested objects properly. We already have a manual merge process in place for PATCH requests but tweaking that to also handle PUT requests gracefully caused more complexity than anticipated.

We now switched to an object based merge so that we can read in the source JSON structure into a new object and then merge the objects.

Related pull request: #247.
2017-01-23 16:42:41 +01:00
Oliver Gierke
96ff0cb465 DATAREST-986 - DomainObjectReader now merges complex nested maps correctly.
We now use a Map property's generic type information to make sure we convert both the key and the value into the declared types. Previously we just used Object if the source value to map was null. Object is still used as fallback for raw maps though.
2017-01-23 09:30:49 +01:00
Oliver Gierke
2b9c7847b4 DATAREST-970 - AnnotationEventHandlerInvoker now considers order of event handler methods.
We now make sure that an @Order annotation on annotated event handler methods are considered and the methods are invoked in the defined order.

Non-annotation-based event handlers don't suffer from the same problem as they're ApplicationListener instances directly so that the container will enforce the correct ordering in case @Order is used or Ordered is implemented.

Some cleanup in EventHandlerMethod.

Original pull request: #248.
2017-01-19 15:09:56 +01:00
Oliver Gierke
2ad00c0dd7 DATAREST-982 - Adapt to changes in Jackson default time rendering in test case.
We now configure a more explicit pattern to verify the ISO date rendering of Jackson.
2017-01-16 17:27:42 +01:00
Oliver Gierke
5212d1389f DATAREST-976 - Polishing.
Extracted test for the newly supported sorting scenario so that we now.

Original pull request: #251.
2017-01-16 13:36:38 +01:00
Mark Paluch
69c39377ec DATAREST-976 - Embedded properties are now considered in sort property paths.
We now allow sorting by properties of embedded objects. An embedded object is not linkable to a root object but embedded in the resource itself. If any part of the sort property path points to a linkable association, the whole sort property path is discarded silently and not used for sorting any further.

Original pull request: #251.
2017-01-16 13:36:15 +01:00
Mark Paluch
ebe45bcf1f DATAREST-979 - Update project documentation with the CLA tool integration. 2017-01-13 11:56:23 +01:00
Mark Paluch
e2f88141ca DATAREST-978 - Polishing.
Convert @see http://… links to valid format using @see <a href=…>…</a>.
2017-01-13 10:09:53 +01:00
Mark Paluch
6bb989018c DATAREST-978 - Migrate ticket references in test code to Spring Framework style. 2017-01-13 10:09:53 +01:00
Oliver Gierke
992512cf96 DATAREST-932 - Updated changelog. 2016-12-21 19:35:37 +01:00
Oliver Gierke
0b2f685a82 DATAREST-862 - Updated changelog. 2016-12-21 18:46:44 +01:00
Oliver Gierke
4eea46aa09 DATAREST-899 - Prefer user registered modules over default ones.
We now issue the user registration of Jackson modules before any of the default modules Spring Data registers get applied. Testing module registration seems to be rather difficult as Jackson doesn't actually expose API to do so. An issue [0] was filed for Jackson to improve on this.

[0] https://github.com/FasterXML/jackson-databind/issues/1478
2016-12-20 12:53:19 +01:00
Oliver Gierke
8c1ee5608b DATAREST-964 - Removed deprecated configuration methods in RepositoryRestMvcConfiguration. 2016-12-20 12:10:43 +01:00
Oliver Gierke
bccb5fdcb8 DATAREST-962 - Fixed imports in Gemfire integration tests after move to Geode. 2016-12-16 11:01:39 +01:00
Oliver Gierke
c03653b7e9 DATAREST-959 - Polishing.
Skip all merge logic if the source value is null. That frees all nested logic from handling with that case and us falling back to plain Jackson reading.

The array handling now also opts out if the source value is not a collection or array in the first place as it means we need to let Jackson override the value with the collection given to be deserialized.

Original pull request: #246.
2016-12-13 10:09:02 +01:00
Milos Cubrilo
0b1bbbab31 DATAREST-959 - Fix adding elements to empty array in DomainObjectReader.
Original pull request: #246.
2016-12-13 10:09:00 +01:00
Oliver Gierke
83899bb42a DATAREST-793 - RepositoryRestConfiguration's setters return this consistently.
Adapted the return type of setter methods in RepositoryRestConfiguration to consistently return the current instance to allow call chaining.
2016-12-12 17:00:05 +01:00
Oliver Gierke
aa7eec4683 DATAREST-835 - Search resources returning a single resource now get and consider ETag and Last-Modified headers.
We now interpret If-None-Match and If-Modified-Since headers on requests to resources backed by query methods returning a single instance only. This allows clients to optimize GET requests to those resources to save bandwidth.
2016-12-08 21:35:37 +01:00
Oliver Gierke
42378ab34d DATAREST-957 - Polish most critical Sonar warnings.
Fixed broken equals(…) in ProjectionDefinition. Switched to iterating over Map's entry set instead of the keys. Made UriAwareHttpServletRequest static.
2016-12-08 10:12:31 +01:00
Oliver Gierke
c0df12d9fa DATAREST-956 - Polishing.
Some tiny refactorings in DomainObjectReader. We're now using TypeInformation instead of Class to preserve more generics information when it comes to deeper nesting.

Moved some code around in the unit tests.

Original pull request: #245.
2016-12-08 09:49:17 +01:00
Mathias Düsterhöft
667576c661 DATAREST-956 - Fixed handling of collection element addition and removal for PUT requests.
DomainObjectMerger now properly adds and removes elements to and from collections.

Original pull request: #245.
2016-12-08 09:48:20 +01:00
Oliver Gierke
6c99760621 DATAREST-953 - Added test case to verify this is fixed.
Seems the change for DATAREST-938 has also fixed this one. Added a test case similar to what was provided in the example for the original ticket.
2016-12-07 18:50:44 +01:00
Oliver Gierke
e7c4b2176e DATAREST-938 - Polishing.
Formatting and author.

Original pull request: #241.
2016-12-07 18:50:42 +01:00
Craig Andrews
b859b8b91f DATAREST-938 - Update nested entities instead of replacing them with new instances.
Original pull request: #241.
2016-12-07 18:50:38 +01:00
Oliver Gierke
a4f88fe1ac DATAREST-910 - Polishing.
Minor code reorganizations. Eagerly create SortTranslator to avoid repeated instantiation.

Original pull request: #232.
2016-12-06 12:00:39 +01:00
Mark Paluch
0dc97dcc56 DATAREST-910 - Support nested Sort properties.
We now support nested Sort properties considering Jackson mapping. Sort translation is optional and skipped if the domain class is not resolvable. Translation in the scope of a domain class maps property paths to apply sorting using embedded properties.

A sort string `nested-name` resolves to a property path `anotherWrap.embedded.name`.

class Aggregate {

	@JsonUnwrapped
	public UnwrapEmbedded anotherWrap;
}

class UnwrapEmbedded {

	@JsonUnwrapped(prefix = "nested-")
	public Embedded embedded;
}

class Embedded {
	public String name;
}

Original pull request: #232.
2016-12-06 12:00:38 +01:00
Mark Paluch
24d26943af DATAREST-910 - Adopt interfaces for Pageable and Sort method argument resolvers.
Original pull request: #232.
2016-12-06 12:00:38 +01:00
Oliver Gierke
7855613415 DATAREST-937 - Polishing.
Moved the newly added test case to the end of the list. Formatting.

Original pull request: #240.
2016-12-06 09:38:19 +01:00
Craig Andrews
4150688851 DATAREST-937 - Transient properties in JSON are now included in merge.
We now don't prematurely drop fields that don't have a persistent property exposed in DomainObjectReader. Doing so dropped values for transient fields as the latter are not exposed as persistent property in the first place. We still skip any nested merging though.

Original pull request: #240.
2016-12-06 09:38:19 +01:00
Ken Dombeck
603db869c0 DATAREST-951 - Fixed example in sample in reference documentation.
Original pull request: #244.
2016-12-06 08:32:54 +01:00
Oliver Gierke
21b7d7cbed DATAREST-925 - Polishing.
Original pull request: #238.
2016-12-02 20:17:08 +01:00
Craig Andrews
8149a02820 DATAREST-925 - Invoke ResourceProcessors for ProjectionResources.
The serializer for projection resources now also invokes ResourceProcessor instances registered for that particular projection.

Original pull request: #238.
2016-12-02 20:17:08 +01:00
Lukasz Kryger
80e9af743d DATAREST-960 - Fixed typos in reference documentation.
Fix typo "returnBodyOnupdate" -> "returnBodyOnUpdate".

Original pull request: #242.
2016-12-02 19:41:38 +01:00
Oliver Gierke
9fea1ab605 DATAREST-941 - Polishing.
Minor formatting in pom.xml of the HAL Browser module.
2016-11-30 18:25:57 +01:00
Greg Turnquist
015a8a331b DATAREST-941 - Modify existing browser.html
Instead of replacing the HAL Browser's browser.html, take the existing one and alter it inside the build job. This ensures that future updates don't break so horribly.

Related to https://github.com/mikekelly/hal-browser/pull/89 which will provide an explicit token to match, instead of using the closing `</body>` tag.
2016-11-30 18:25:57 +01:00
Oliver Gierke
78ca7a7895 DATAREST-934 - After release cleanups. 2016-11-23 10:59:11 +01:00
Oliver Gierke
03aa65890e DATAREST-934 - Prepare next development iteration. 2016-11-23 10:59:09 +01:00
Oliver Gierke
4e8771eee8 DATAREST-934 - Release version 3.0 M1 (Kay). 2016-11-23 10:35:48 +01:00
Oliver Gierke
3f408ba0fd DATAREST-934 - Prepare 3.0 M1 (Kay). 2016-11-23 10:35:08 +01:00
Oliver Gierke
aa3fa8da91 DATAREST-934 - Updated changelog. 2016-11-23 10:35:04 +01:00
Oliver Gierke
8327b6f4ab DATAREST-935 - Prepare 3.0 development.
Upgraded version numbers and dependencies to Spring Data build parent, Commons and store modules. Fixed a compiler issue in DomainObjectReader.
2016-11-18 16:13:54 +01:00
Oliver Gierke
f4705c8197 DATAREST-941 - Upgraded to latest version of the HAL Browser. 2016-11-17 00:03:35 +01:00
Oliver Gierke
63bc492140 DATAREST-915 - Updated changelog. 2016-11-03 18:56:47 +01:00
Oliver Gierke
8fd259dd32 DATAREST-906 - Polishing. 2016-11-03 16:28:33 +01:00
Oliver Gierke
7329e20fa8 DATAREST-919 - Merging of nested maps for PUT/PATCH requests now handles nested arrays and simple types. 2016-11-03 16:19:46 +01:00
Oliver Gierke
68d0a1aa6a DATAREST-931 - Polishing.
Switched to non-deprecated property naming strategy in test case.
2016-11-03 09:13:52 +01:00
Oliver Gierke
50d2678d01 DATAREST-931 - DomainObjectMerger now handles arrays with complex objects correctly.
We now explicitly manually merge array nodes that contain complex objects. Previously arrays would've been skipped and the subsequent Jackson update would wipe out all properties not contained in the original document even on PATCH requests.
2016-11-02 13:40:54 +01:00
Oliver Gierke
40bb8e8e6c DATAREST-573 - Polishing.
Removed RepositoryRestConfiguration.addCorsMapping(…) as we currently don't have any other shortcut methods for configuration like this.

Tweaked the setup of (now Repository)CorsConfigurationAccessor to be created earlier so that we avoid recreation for every lookup. Introduced a NoOpStringValueResolver to be used by default so that we don't need to deal with the case of the resolver being null at the end of the call chain. Replaced constructor of RepositoryCorsConfigurationAccessor with corresponding Lombok annotation.

Updated reference documentation accordingly.

Original pull request: #233.
2016-10-28 14:19:26 +02:00