Commit Graph

1641 Commits

Author SHA1 Message Date
Mark Paluch
d1b59f8cf6 DATAREST-1059 - Updated changelog. 2017-06-08 11:56:20 +02:00
Mark Paluch
978b287a6f DATAREST-1058 - Updated changelog. 2017-06-07 12:23:36 +02:00
Oliver Gierke
87790ccb18 DATAREST-1079 - Upgraded to EvoInflector 1.2.2. 2017-05-18 14:52:20 +02:00
Oliver Gierke
e4f34aaa67 DATAREST-1076 - Expose constructor that takes RelProvider of RepositoryResourceMappings.
We now expose the constructor that takes a RelProvider in RepositoryResourceMappings so that clients can tweak the default relation names. Changed the order of constructor parameters of (previously) non-public constructors for consistency.

The RelProvider to be used with the mappings can now be configured via RepositoryRestConfiguration and defaults to the EvoInflector based one.
2017-05-18 14:49:44 +02:00
gregory
2c927af0b5 DATAREST-1077 - HAL Browser: Pass request headers in ALL requests
Pass headers from HAL.client on requests so custom request headers aren't lost.
E.g. custom Authorization: bearer <token> headers
2017-05-16 22:24:41 -05:00
Oliver Gierke
9a9512767e DATAREST-1039 - Fix appending a complex value appended to a collection via JSON Patch.
When a PATCH call using JSON Patch tried to append an item to an empty collection, it previously failed to look up the type to unmarshal the incoming payload to. We now inspect the declared types on the wrapped object's property to determine that type for append operations.

Also, an uninitialized collection is now initialized using Spring's CollectionFactory.
2017-05-12 14:54:24 +02:00
Mark Paluch
b0c19ce188 DATAREST-1052 - After release cleanups. 2017-05-09 11:34:42 +02:00
Mark Paluch
793c09270d DATAREST-1052 - Prepare next development iteration. 2017-05-09 11:34:41 +02:00
Mark Paluch
edaf6197e2 DATAREST-1052 - Release version 3.0 M3 (Kay). 2017-05-09 11:23:00 +02:00
Mark Paluch
5d41cb01ec DATAREST-1052 - Prepare 3.0 M3 (Kay). 2017-05-09 11:22:12 +02:00
Mark Paluch
0cf0c49843 DATAREST-1052 - Updated changelog. 2017-05-09 11:22:09 +02:00
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