Commit Graph

563 Commits

Author SHA1 Message Date
Oliver Gierke
1bb228df17 DATAREST-502 - Prepare request parameters to enable URI-to-entity resolution for executing searches.
RepositorySearchController now takes all request parameters as MultiValueMap to execute query methods. For parameters mapping to a managed resource we try to interpret the given parameter value as URI to actually trigger the URI-to-entity resolution through the newly registered UriToEntityConverter.

The latter is now registered with the default ConversionService registered so that it's

A lot of cleanups in RepositorySearchController. Removed some obsolete prints to the console to reduce log output during test execution.

Related ticket: DATACMNS-678.
2015-04-07 17:02:16 +02:00
Greg Turnquist
e741f90378 DATAREST-503 - Fix typo in reference docs
Mispelled word in SDR's reference documentation. Patched.

Courtesy of https://github.com/spring-projects/spring-data-rest/pull/172
2015-04-02 12:52:05 -05:00
Oliver Gierke
2697c6a2fa DATAREST-302 - Rendering projections includes/keeps links.
We now treat embedded projections as Resource instances and equip them with a self link. This should also allow to register ResourceProcessor instances for projection types to even add projection specific links if necessary.

Also removed the explicit removal of the association link in case a projection is rendered for an association.
2015-04-02 16:15:39 +02:00
Oliver Gierke
3b55dceef7 DATAREST-500 - Enable lazy-loading proxy resolution on Hibernate 4 module.
We now explicitly activate the resolution of lazy-loading proxies on Hibernate 4 to make sure not already populated lazy-loading proxies are actively resolved.
2015-03-30 21:31:02 +02:00
Oliver Gierke
a446527da3 DATAREST-498 - IncomingRequest now correctly evaluates parameterized media types.
IncomingRequest.isJsonPatchRequest()/….isJsonMergePatchRequest() previously did a hard equals comparison to the media type discovered in the request. This fails if the request's media type contains parameters (e.g. the charset).

We now rather use MediaType.isCompatibleWith(…) to compare the media types more leniently.

Renamed test case to match conventions so that the Maven build actually executes them.
2015-03-30 10:42:40 +02:00
Oliver Gierke
9d42d30595 DATAREST-493 - After release cleanups. 2015-03-23 14:02:45 +01:00
Spring Buildmaster
829bbdd221 DATAREST-493 - Prepare next development iteration. 2015-03-23 05:36:59 -07:00
Spring Buildmaster
338047fd62 DATAREST-493 - Release version 2.3.0.RELEASE (Fowler GA). 2015-03-23 05:36:57 -07:00
Oliver Gierke
830ed24299 DATAREST-493 - Prepare 2.3.0.RELEASE (Fowler GA). 2015-03-23 12:37:23 +01:00
Oliver Gierke
243ba4c1d4 DATAREST-493 - Updated changelog. 2015-03-23 12:04:14 +01:00
Oliver Gierke
c12009337b DATAREST-494 - ALPS metadata now links to JSON Schema.
The ALPS document rendered now links to the JSON Schema document from within the core representation descriptor to allow clients to obtain more detailed information about the payloads to send and receive.
2015-03-23 08:49:48 +01:00
Oliver Gierke
e5ce6156f9 DATAREST-492 - Fixed JSON Schema type detection for primitive numbers.
We now correctly detect primitive numbers in domain objects so that the JSON Schema type of the property is number as expected.
2015-03-22 20:06:43 +01:00
Greg Turnquist
462570fc24 DATAREST-449 - Polished up reference docs.
Original pull request: #170.
2015-03-22 18:11:11 +01:00
Greg Turnquist
707bac94c2 DATAREST-478 - Polished up bits of documentation.
Original pull request: #169.
2015-03-22 18:06:59 +01:00
Greg Turnquist
583284a9f0 DATAREST-453 - Added appendix linking to Spring Data examples.
Added a new section that lists Spring Data REST specific example projects.

Original pull request: #168.
2015-03-22 18:06:25 +01:00
Oliver Gierke
f80bebf04b DATAREST-491 - Fixed handling of non-entity maps in JSON processing.
During our custom JSON handling on PUT requests, we previously piped all JSON objects through code that expected that one to be mapped to a PersistentEntity. This fails for JSON objects that basically represent maps.

We now skip that code paths for non-entity properties.
2015-03-20 09:42:36 +01:00
Oliver Gierke
5486712b1b DATAREST-34 - Polishing.
Moved decision logic on whether to return response bodies int RepositoryRestConfig to ease testability of the controller. Added more unit tests and simplified the controller integration tests accordingly. Had to deactivate some Cassandra related tests as they don't seem to handle nulling of properties correctly.

Changed configuration to rely on the presence of the Accept header by default. Deprecated parameterless isReturnBodyFor…(…) methods in favor of the ones taking the Accept header to avoid the null checks on the calling side.

Polished JavaDoc for the isReturnBodyOn(Create|Update) methods. Polished formatting in RepositoryEntityController.

Original pull request: #167.
2015-03-20 08:50:47 +01:00
Jeremy Rickard
f3c74ac9db DATAREST-34 - PUT and POST request now consider Accept header by default.
By default, whether to return response bodies for PUT and POST is determined by the presence of an Accept header, unless explicitly activated or deactivated in RepositoryRestConfiguration.

Original pull request: #167.
2015-03-20 08:50:30 +01:00
Oliver Gierke
4f8298c711 DATAREST-490 - Makes sure content negotiation works for manual resource overrides with dedicated media type.
In case a manually implemented controller is registered to add a dedicated media type for a Spring Data REST resource (e.g. an HTML representation for item resources) we now continue to serve JSON in case the request indicates it wants to see it.

Previously this didn't work as the manually implemented controller method was detected to partially match (only the produces-clause not matching) and thus an exception being thrown from the HandlerMapping lookup. This caused the HandlerMapping registered for repositories not being considered at all.

This is now fixed by hiding the HandlerMapping instances we register behind a DelegatingHandlerMapping that continues to try delegates even in a case of an exception being caused in a particular resolution attempt. Should all resolution attempts fail, we then throw the original exception if one occurred in the first place.
2015-03-11 15:14:00 +01:00
Oliver Gierke
83e1ca0072 DATAREST-487 - After release cleanups. 2015-03-11 15:13:56 +01:00
Spring Buildmaster
7b53546236 DATAREST-487 - Prepare next development iteration. 2015-03-05 10:28:08 -08:00
Spring Buildmaster
c52b72047f DATAREST-487 - Release version 2.3.0.RC1. 2015-03-05 10:28:07 -08:00
Oliver Gierke
8f988036e2 DATAREST-487 - Prepare 2.3.0.RC1 (Fowler RC1). 2015-03-05 19:18:07 +01:00
Oliver Gierke
791f6d057c DATAREST-487 - Updated changelog. 2015-03-05 15:54:43 +01:00
Oliver Gierke
b1ef67211f DATAREST-487 - Dependency upgrades in preparation of the release.
Upgraded to Spring HATEOAS 0.17.0.RELEASE, Spring Plugin 1.2.0.RELEASE as well as Evo Inflector 1.2.1.
2015-03-05 11:22:29 +01:00
Oliver Gierke
def74e6618 DATAREST-354 - General rewrite of the JSONSchema support.
Significant overhaul of the JSONSchema support. This currently adds the following features:

- Complex nested types are exposed as descriptors with the properties pointing to them whenever necessary.
- Sets are treated as unique collections.
- Enums are handled as expected (enum values are listed).
- Renamings via @JsonProperty are considered.
- @JsonProperty(required = true) is considered and added to required properties.
- Date/time types (legacy Date, JSR-310, ThreeTenBP and Joda Time) are exposed with format "date-time".
- Objects with @JsonValue methods are considered to be rendered as String value.
- Formats and patterns can be manually configured on MetadataConfiguration.

TODOs:

- Implementation polish, JavaDoc
- Automatically inspect ObjectMapper to detect customizations made through Mixins and custom Serializers.
2015-03-05 10:13:47 +01:00
Tom Crossland
ed5bde10e7 DATAREST-484 - Corrected a tiny spelling mistake in projections-excerpts.adoc.
Original pull request: #166.
2015-03-04 11:53:45 +01:00
Oliver Gierke
c532bb0d51 DATAREST-485 - Fixed handling of empty requests for RepositoryPropertyReferenceController.createPropertyReference(…).
The test case introduced for DATAREST-482 failed when running against Spring 4.1 generation as the handling of empty request payload changed slightly in 4.1. We now explicitly use required = false to get null handed into the controller and manually default the Resources<Object> in it.

Related tickets: DATAREST-482, SPR-12778.
2015-03-03 09:49:38 +01:00
Oliver Gierke
8cbd952d88 DATAREST-483 - Upgrade to JSONPath 0.9.1 and Spring HATEOAS 0.17.0 snapshots. 2015-03-02 17:41:02 +01:00
Greg Turnquist
ebbe77da5b DATAREST-450 - Migrate wiki content to reference docs.
Scrubbed old format. Lightened up paging section and focus more on "next"/"prev" hypermedia controls and their benefit. Moved several sections under one top level section called "Customizing Spring Data REST". Cleaned up index.adoc to match the style of Spring Data JPA. Removed JSONP section.
Remove embedded entity operations, based on old spring-data-rest-compact media type. Utilized relative leveloffset for each include. Corrected some ALPS mistakes.

Original pull request: #162.
2015-02-27 10:13:26 +01:00
Oliver Gierke
8b3b7bac98 DATAREST-482 - Added test cases for MongoDB association handling on PUTs.
Added a test case that verifies associations to stay intact if someone updates the item resource using a PUT. Added a second test case that shows PUTting an empty String with media type text/uri-list results in the associations wiped.
2015-02-26 11:48:08 +01:00
Greg Turnquist
7d13c447fe DATAREST-451 - Add projection and excerpt to reference documentation.
Original pull request: #163.
2015-02-25 17:19:01 +01:00
Greg Turnquist
d6595970e3 DATAREST-452 - Add ALPS metadata to reference documentation.
Original pull request: #164.
2015-02-25 15:45:34 +01:00
Oliver Gierke
0a542564bc DATAREST-463 - Polishing.
Collapsed if clauses leading to the very same return in RootResourceinformationToAlpsDescriptorConverter. Renamed isExportableProperty(…) to isExportable(…) in JacksonMetadata. Removed commented out code in AssociationLinks. Cleanups in test code.

Original pull request: #160.
2015-02-22 15:23:46 +01:00
Greg Turnquist
8d47fab92c DATAREST-463 - Hide ignored attributes from ALPS metadata.
If @JsonIgnore is applied to either a field or a getter method for an association, then do not expose that property's metadata down from ALPS.

Original pull request: #160.
2015-02-22 15:21:24 +01:00
Oliver Gierke
98fd079b21 DATAREST-469 - Added dedicated resource type for search links.
RepositorySearchController now returns a RepositorySearchesResources so that users can implement a custom ResourceProcessor to augment the list of links exposed for Spring Data repository query methods.
2015-02-09 10:52:37 +01:00
Oliver Gierke
ec2bd0145d DATAREST-471 - Populate Last-Modified headers from auditing information.
We now populate the Last-Modified header for requests to the item resource and search resource invocations that return a single item.
2015-02-04 21:03:57 +01:00
Oliver Gierke
14cee9c94f DATAREST-467 - RepositoryEntityLinks now exposes methods to create links to search resources.
RepositoryEntityLinks now exposes methods to obtain links to all search resources and individual ones, including overloads to pre-expand Pageable and Sort parameters potentially contained in the method signature.

Search links now also contain a projection template variable if the type returned by the query method backing the search resource has projections registered.
2015-01-30 20:46:03 +01:00
Oliver Gierke
7d9db83e97 DATAREST-459 - Updated changelog. 2015-01-28 20:55:57 +01:00
Oliver Gierke
349979a321 DATAREST-458 - Updated changelog. 2015-01-28 10:16:46 +01:00
Oliver Gierke
ec6ee8e291 DATAREST-470 - Moved to EclipseLink JPA API JAR instead of Hibernate. 2015-01-27 22:21:30 +01:00
Oliver Gierke
3eb0691d95 DATAREST-468 - Added patch media types to documentation section of item resources. 2015-01-27 08:31:26 +01:00
Oliver Gierke
fbd803f32a DATAREST-414 - Added retry logic to connect to embedded Cassandra.
The Cassandra tests sometimes cannot to the embedded instance on the CI server. Added a triple retry with a delay of 200ms to work around a potentially slow Cassandra bootstrap.
2015-01-21 15:24:13 +01:00
Oliver Gierke
c67b3e749d DATAREST-461 - Ignore unmapped properties when applying PUT requests.
We now make sure that unmapped properties (e.g. by using @JsonIgnore) are ignored when applying PUT request payloads. To do so we now basically use the merging algorithm used for PATCH requests but make sure we fill up the request payload with explicit null values for all mapped but not contained properties.
2015-01-21 14:44:48 +01:00
Oliver Gierke
1755a82fe2 DATAREST-460 - Polished RepositoryRestMvcConfiguration to fix CGLib proxying.
Made private methods that call @Bean methods protected so that they can become subject to CGLib proxying. Inlined getDefaultedRelProvider().
2015-01-20 10:39:21 +01:00
Neeme Praks
f755987a02 DATAREST-457 - Fixed typo in JavaDoc of BaseUri.
Original pull request: #159.
2015-01-20 08:00:50 +01:00
Oliver Gierke
65f45d6433 DATAREST-448 - RepositoryRestHandlerMapping is now checking for a repository mapping again.
Re-introduced the accidentally removed checks that the resolved handler method actually points to a repository resource.
2015-01-16 14:43:21 +01:00
Oliver Gierke
c3ffe7793b DATAREST-446 - Removed RepositoriesUtils in favor of RepositoryMetadata.
To be sure to pick up domain type lookup customizations we now consistently use RepositoryMetadata instead of trying to be clever and re-detecting it via RepositoriesUtils.
2015-01-16 13:15:38 +01:00
Oliver Gierke
8700c60cef DATAREST-445 - Fixed domain type lookup in RepositoryCollectionResourceMapping.
We now use the domain type provided by RepositoryMetadata instead of manually looking up to be sure to pick up customizations correctly.
2015-01-16 12:22:17 +01:00
Oliver Gierke
a2ba4224fb DATAREST-414 - Polishing.
Extracted groups of dependencies into auto-activated profiles to make more visible which dependencies belong to which store. Simplified dependency setup where possible.

General polishing in the test cases added.
2015-01-11 17:53:10 +01:00