Commit Graph

880 Commits

Author SHA1 Message Date
Oliver Gierke
3b0c73f109 DATAREST-1067 - EntityLookup.lookupEntity(…) now returns Optional<T>. 2017-05-04 23:56:40 +02:00
Oliver Gierke
f906695e7a DATAREST-1064 - Adapt to API changes in repository interfaces.
Additional cleanups in QuerydslAwareRootResourceInformationHandlerMethodArgumentResolver to make sure a QuerydslRepositoryInvokerAdapter is only applied if the QuerydslPredicateBuilder actually exposes a predicate. Extracted a couple of methods to make sure the mapping pipeline reads nicely.
2017-05-03 18:10:27 +02:00
Oliver Gierke
632ca25998 DATAREST-1057 - Updated changelog. 2017-04-19 21:04:20 +02:00
Oliver Gierke
7260c9553a DATAREST-1056 - Updated changelog. 2017-04-19 20:01:48 +02:00
Oliver Gierke
886f920093 DATAREST-1017 - Updated changelog. 2017-04-19 13:04:09 +02:00
Oliver Gierke
b5d5e2cdee DATAREST-1016 - Updated changelog. 2017-04-19 11:50:50 +02:00
Mark Paluch
f94a534fac DATAREST-1019 - Consider base URI when resolving cross-origin configuration on repositories.
We now consider the base URI when resolving CORS configuration from repository interfaces. The base URI is now stripped from the request. Previously the base URI was not stripped from the request and was used to determine an exported resource.
2017-04-18 19:55:29 +02:00
Oliver Gierke
2ebc688631 DATAREST-1055 - Move to Optional for base link handling in repository controllers. 2017-04-18 13:20:18 +02:00
Michael J. Simons
2a2c4154be DATAREST-1046 - Fix instructions how to manually add a validator.
Original pull request: #264.
2017-04-11 10:22:03 +02:00
Oliver Gierke
2b347daaab DATAREST-1050 - PUT for create now makes sure the resource id is set on the instance to create.
So far, we handed the plain instance deserialized from the request body to the repository to persist it. That caused issues in PUT for create scenarios where the URI contains the identifier to be used for the aggregate to create and identifier generation being used in the backend. In that case the identifier submitted was never considered and subsequent requests would've created new instances, effectively breaking the idempotent nature of PUT.

We now make sure the backend identifier derived from the resource is set on the aggregate instance about to be created, so that backend can either accept that situation (new entity + manually defined identifier) or reject it (in case it insists on identifier generation).
2017-04-11 09:10:04 +02:00
Oliver Gierke
359513fe9b DATAREST-1030 - Reinstantiate PATCH behaviour for associations.
We now completely opt out of merging values if the property is a linkable association.
2017-04-10 19:08:03 +02:00
Oliver Gierke
06c2b746c4 DATAREST-989 - Updated changelog. 2017-04-10 14:06:15 +02:00
Oliver Gierke
701b23b5f9 DATAREST-946 - After release cleanups. 2017-04-04 22:08:19 +02:00
Oliver Gierke
680d84fe4e DATAREST-946 - Prepare next development iteration. 2017-04-04 22:08:15 +02:00
Oliver Gierke
fceb36ff71 DATAREST-946 - Release version 3.0 M2 (Kay). 2017-04-04 21:12:35 +02:00
Oliver Gierke
63504a7f0e DATAREST-946 - Prepare 3.0 M2 (Kay). 2017-04-04 21:12:02 +02:00
Oliver Gierke
95c013e507 DATAREST-946 - Updated changelog. 2017-04-04 21:11:57 +02:00
Christoph Strobl
d88240e13b DATAREST-1044 - Update Solr test module after changes in Spring Data Solr.
Update to Solr 6.5 and adapt schema and request handlers.
2017-04-04 16:02:16 +02:00
Oliver Gierke
03d5cbead5 DATAREST-1043 - Switched to a non-default APT output path.
See [0] for why this is necessary.

[0] https://issues.apache.org/jira/browse/MCOMPILER-271
2017-04-04 10:53:02 +02:00
Oliver Gierke
1bc5a1ab55 DATAREST-1042 - Adapted to API changes in AbstractMongoConfiguration. 2017-04-04 10:46:12 +02:00
Oliver Gierke
b9957d1a6c DATAREST-1008 - Adapt to API changes in Spring Data Commons, Java 8 upgrades and Mockito 2.7. 2017-03-24 11:02:54 +01:00
Mark Paluch
272dc179ad DATAREST-1020 - Mention correct method in reference docs to configure global CORS mappings.
Point in reference documentation to `addMapping(…)` instead of `addCorsMapping(…)`.
2017-03-08 11:20:13 +01:00
Oliver Gierke
7295535d16 DATAREST-1018 - Prevent NullPointerException in UriToEntityConverter.
In case PersistentEntities exposes a managed type whose raw type currently doesn't have a PersistentEntity registered, the constructor of UriToEntityConverter ran into a NullPointerException.

We now explicitly check for null and skip those types.

Filed DATAREST-1021 for further improvements in the 3.0 time frame.
2017-03-07 14:50:44 +01:00
Oliver Gierke
e632196290 DATAREST-990 - Updated changelog. 2017-03-02 11:11:05 +01:00
Oliver Gierke
a13f51b49e DATAREST-1003 - Entity resources don't answer arbitrary JSON requests.
Previously, when a request was sending an Accept header of some arbitrary *+json, the request was routed through the controllers and might have ended up producing a PersistentEntityResource that was then mapped using an uncustomized Jackson ObjectMapper. That has caused a huge JSON object to be unfolded which is highly undesirable.

We now only answer JSON requests to repository resources that contain an Accept header with any of the explicit JSON media types we got registered.

Tweaked the setup of the ExceptionHandlerExceptionResolver to not expose a bean in the first place but rather use the Spring MVC provided callbacks to register custom ones. We also now make sure MVC is bootstrapped property for integration tests through the inclusion of DelegatingWebMvcConfiguration.
2017-03-01 21:39:51 +01:00
Oliver Gierke
8ad81978b0 DATAREST-995 - Removed support for ~ to reference a last collection element in JSON Patch.
Completely removed the support for ~ in favor of the previously introduced support for the correct indicator -.
2017-02-08 19:59:08 +01:00
Oliver Gierke
4e2edd2d37 DATAREST-995 - Fixed detection of collection append operations for JSON Patch requests.
We previously erroneously looked for a ~ in a JSON Pointer to indicate collection append in e.g. an add operation. We now also support the actually correct - keeping the original behavior for now to not break clients that currently make use of it.
2017-02-08 19:59:08 +01:00
Jens Schauder
ea482e0577 DATAREST-994 - Fixed two argument constructor of RepositoryRestHandlerMapping.
Repositories in RepositoryCorsConfigurationAccessor may be null now. findCorsConfiguration returns null when no repositories are provided.

Original pull request: #257.
2017-02-03 09:07:20 +01:00
Mark Paluch
b06f8664f1 DATAREST-992 - Remove references to Assert single-arg methods.
Replace references to Assert single-arg methods with references to methods accepting the test object and message.

Related ticket: SPR-15196.
2017-02-01 13:25:13 +01:00
Oliver Gierke
a612f4a2ac DATAREST-966 - Updated changelog. 2017-01-26 12:12:37 +01:00
Oliver Gierke
248250329f DATAREST-967 - Updated changelog. 2017-01-26 12:12:08 +01:00
Oliver Gierke
7c3bf750b3 DATAREST-944 - DomainObjectMerger now also merges associations for PUT.
We now explicitly merge associations skipping the linkable ones. We also try to reuse the existing collections and maps if they're mutable falling back to a completely new one if not.

Extracted PropertyHandler and AssociationHandler implementations.
2017-01-26 07:45:25 +01:00
Oliver Gierke
74cc5551a5 DATAREST-983 - AnnotatedEventHandlerInvoker now resolves generic handler method argument.
We now resolve the handler method argument type of an annotated repository event handler against the concrete handler type to make sure generics are resolved properly.
2017-01-24 16:57:53 +01:00
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