Commit Graph

638 Commits

Author SHA1 Message Date
vtsukur
d964522af4 DATAREST-711 - Actualized examples with projection configuration and fixed typos.
Original pull request: #202.
2015-12-13 16:22:03 +01:00
Oliver Gierke
6b44c62f33 DATAREST-729 - Removed relative reference to parent POM. 2015-12-13 16:22:00 +01:00
Oliver Gierke
0736511176 DATAREST-714 - Reference documentation now mentions RepositoryrestConfigurer instead of RepositorytestMvcConfiguration.
Fixed documentation on how to customize Spring Data REST by moving away from extending RepositoryRestMvcConfiguration to RepositoryRestConfigurer.
2015-11-25 14:46:13 +01:00
Oliver Gierke
6068a1788d DATAREST-705 - DomainObjectReader now doesn't wipe identifier and version properties.
Identifier and version properties are handled in a special way by Spring Data REST (ids are derived from and exposed via the URI, versions make it into the ETag header) and are not contained in the response representation. That requires handling PUT request having to explicitly exclude them from being wiped to null so that the server side values are still preserved.
2015-11-20 16:53:52 +01:00
Oliver Gierke
6e3835d956 DATAREST-707 - Updated changelog. 2015-11-16 08:57:37 +01:00
Oliver Gierke
02f74382aa DATAREST-706 - Added unit test for fixed functionality.
Original pull request: #200.
2015-11-13 17:35:13 +01:00
Artur M
284cdd9bc8 DATAREST-706 - RepositoryExceptionHandler.handleMiscFailures(…) now passes exception instead of null.
Original pull request: #200.
2015-11-13 17:35:13 +01:00
Oliver Gierke
c3d3caaebf DATAREST-701 - Fixed potential NullPointerException in DomainObjectReader.
We now skip nested Map handling in case the Map value is not a managed entity. Also added a more strict guard against the PersistentEntity lookup to make sure users see a more descriptive error in case of failures.
2015-11-10 12:11:46 +01:00
Oliver Gierke
57c503ea85 DATAREST-690 - Fixed JSON schema handling for collection associations.
We now make sure not to render an items nor an uniqueItems clause for collection associations as they are exposed as URIs for which JSON schema doesn't allow these attributes.
2015-11-09 08:39:59 +01:00
Oliver Gierke
0850f091ca DATAREST-699 - Fixed pageable parameters showing up as is in search resource links on Java 8.
We now explicitly drop parameters of type Pageable and Sort from being exposed as search resource parameters as they're added via the UriComponentsContributors anyway. This prevents "pageable" from showing up as parameter on Java 8 code compiled with -parameters. The latter adds naming information for the Pageable parameter and caused it showing up as is despite the fact that the UriComponentsContributor for Pageables exposes a dedicated syntax.
2015-11-06 16:39:27 +01:00
Oliver Gierke
ffa80e11ca DATAREST-693 - Updated changelog. 2015-10-14 14:02:17 +02:00
Oliver Gierke
465bcdc689 DATAREST-674 - Defensively handle potential double slashes in lookup
path.

We now defensively replace all double slashes contained in the lookup
path as Spring 4.2 might return such paths due to a regression in
UrlPathHelper. This might occur if the original URL contains
intermediate matrix parameters (e.g. /books/;test/1) whose removal now
results in double slashes and thus the downstream repository metadata
lookup to fail.

Related tickets: SPR-13455.
2015-09-10 09:27:49 +02:00
Oliver Gierke
0704f33a6c DATAREST-669 - Include section on dependency management from Spring Data Commons into reference docs.
Related tickets: DATACMNS-762.
2015-09-03 18:20:49 +02:00
Oliver Gierke
ec8806761f DATAREST-663 - Updated changelog. 2015-09-01 12:33:29 +02:00
Oliver Gierke
1228783170 DATAREST-662 - Polishing.
Simplified test case. Added author tags.
2015-08-29 15:53:59 +02:00
Valentin Rentschler
003706024a DATAREST-662 - Tweaked UriStringDeserializer to work for polymorphic references. 2015-08-29 15:53:59 +02:00
Oliver Gierke
5f1a3c6b3e DATAREST-363 - Fixed Resources setup for embedded values in PersistentEntityResource.
We're now creating a dedicated Resources inner class to be able to explicitly ignore the links of the embedds as they would cause the link attribute to be rendered when the unwrapping is applied in the custom JSON serializer.

Polished test case. Foxed Javadoc in PersistentEntityResource.Builder. Tweaked the TestDataPopulator to always reinitialize the data set to make sure the test cases see the expected data.
2015-08-29 15:53:55 +02:00
Greg Turnquist
6ab96a55fe DATAREST-363 - Added test cases exposing legacy format issue.
Added integration test to show the "links" attribute rendered twice in the legacy JSON format.
2015-08-29 15:50:52 +02:00
Oliver Gierke
ea70ba51f4 DATAREST-661 - Fixed non-existant resource detection for PATCH requests.
PATCH requests to non existing resource now correctly return 404 Not Found as PersistentEntityResourceHandlerMethodArgumentResolver.read(…) now correctly throws the ResourceNotFoundException.
2015-08-28 11:03:37 +02:00
Oliver Gierke
e38909c9cf DATAREST-655 - Fixed type in exception message for parameter checks of ParameterMetadata. 2015-08-21 16:00:31 +02:00
Oliver Gierke
006c8b777a DATAREST-647 - Removed unnecessary lookup of the entity to update.
RepositoryEntityController.patchItemResource(…) triggered an additional, unnecessary lookup of the original entity to be updated. However the resolution algorithm for PersistentEntityResource already checks the presence and rejects an invalid identifier with a ResourceNotFoundException.

PersistentEntityResource now carries a boolean flag to expose whether the entity is about to be created. That allows us to avoid the additional lookup in the method handling PUT requests, too.

Related tickets: DATAREST-441.
2015-08-18 17:35:28 +02:00
Oliver Gierke
87bd4450ba DATAREST-634 - Updated changelog. 2015-08-04 14:53:35 +02:00
Greg Turnquist
1bd4e6c7cc DATAREST-632 - Fixed gap in JSON Schema unit tests.
Consolidated constraint tests for JSON Schema test for User and Profile.

Original pull request: #192.
2015-08-04 02:02:32 +02:00
Oliver Gierke
f020127ad7 DATAREST-631 - Polishing.
Moved just introduced test case into PersistentEntityToJsonSchemaConverterUnitTests. Added ticket reference. Removed obsolete test case.

Original pull request: #190.
2015-07-31 16:10:26 +02:00
Greg Turnquist
658c9ff0d8 DATAREST-631 - Expose id attributes with JSON Schema metadata if configured.
The JSON Schema we expose now considers the owning type for configuration to expose the identifier. Previously, we erroneously checked the property type.

Original pull request: #190.
2015-07-31 16:09:42 +02:00
Oliver Gierke
a1d6b6db62 DATAREST-630 - Polishing.
Simplified implementation change. Integrated new test case into the existing one. Cleaned up existing test case to always use TestMvcClient.

Original pull request: #189.
2015-07-31 15:03:30 +02:00
Greg Turnquist
1f9dc1a646 DATAREST-630 - ALPS metadata now only exposes identifier property if explicitly configured to.
The ALPS metadata exposed now considers the id exposure configuration to decide whether to skip the identifier property or not.

Original pull request: #189.
2015-07-31 14:55:57 +02:00
Oliver Gierke
22d7b90cc5 DATAREST-628 - After release cleanups. 2015-07-28 16:28:37 +02:00
Spring Buildmaster
90fe5f7007 DATAREST-628 - Prepare next development iteration. 2015-07-28 07:25:01 -07:00
Spring Buildmaster
bd70e6e133 DATAREST-628 - Release version 2.3.2.RELEASE (Fowler SR2). 2015-07-28 07:24:54 -07:00
Oliver Gierke
b6ba6cb794 DATAREST-628 - Prepare 2.3.2.RELEASE (Fowler SR2). 2015-07-28 14:52:49 +02:00
Oliver Gierke
1640e1f68a DATAREST-628 - Updated changelog. 2015-07-28 14:52:47 +02:00
Fabian Trampusch
480bd60a79 DATAREST-619 - Fixed HTTP method mentioned in Javadoc of RepositoryEntityController.patchItemResource(…).
Previously the Javadoc for said method mentioned PUT as the mapped HTTP method while it's actually PATCH.

Original pull request: #188.
2015-07-27 16:05:47 +02:00
Oliver Gierke
436a1fb9b9 DATAREST-605 - Fixed processing of Maps in DomainObjectReader.
We now post-process Map values recursively to make sure they get merged correctly if they're complex objects in turn.

Improved the exception message for invalid payloads for JSON Patch requests to indicate the expected payload as the root Jackson exception does not contain any hints to what's actually expected.
2015-07-22 17:47:12 +02:00
Oliver Gierke
4d8ba0bdae DATAREST-622 - Removed unnecessary wrapping of embeddeds.
We now use a plain collection of EmbeddedWrapper instead of a Resources to avoid the links contained in the Resources to potentially cause issues on rendering.
2015-07-21 11:59:04 +02:00
Oliver Gierke
df164b05cb DATAREST-606 - Polishing.
Moved the accessibility tweak to the EventHandlerMethod's constructor so that the modification only occurs at detection time. Polished unit test.

Original pull request: #187.
2015-07-19 13:13:12 +02:00
Fabian Trampusch
e759fb8421 DATAREST-606 - Allow non-public @RepositoryEventHandler methods.
AnnotatedEventHandlerInvoker now makes sure the method about to be invoked is accessible.

Original pull request: #187.
2015-07-19 13:13:12 +02:00
Oliver Gierke
da5237538f DATAREST-617 - Fixed content negotiation for requests with Accept: application/*+json.
We now tweak the ProducesRequestConditions for repository controllers to implicitly declare a produces clause of application/*+json to make sure the more concrete produces declarations on methods creating the compact representation are only used as fallbacks.
2015-07-19 13:13:07 +02:00
Oliver Gierke
47693ba5b5 DATAREST-377 - UriStringDeserializer now falls back to null in case of an empty or null source.
UriStringDeserializer now explicitly checks the source JSON value to be null or empty and returns null right away. Previously it handed the value to UriTemplate without any further validation which caused assertion errors in case of an empty or null source.

We now also explicitly catch the IllegalArgumentException thrown from the UriTemplate to make sure that any failure creating a URI (usually from piping a JSON object into the serializer where a URI is expected) is rejected with an appropriate error message.
2015-07-13 08:29:24 +02:00
Antoine Vandecreme
4b3d4dce8b DATAREST-539 - Log exception even if it has no message. 2015-07-09 18:56:17 +02:00
Cedric Ziel
8b3c629c8e DATAREST-596 - Add missing letter to MVC configuration import example 2015-07-09 18:51:06 +02:00
Oliver Gierke
0ec87c5e0a DATAREST-582 - Fixed potential double invocation of annotated event handlers.
AnnotatedEventHandlerInvoker now uses the user class to detect handler methods on to make sure we don't accidentally find CGLib generated methods and thus invoke the handler multiple times later on.

Extended MethodFilter Methods.USER_METHODS to filter methods on CGLib proxy classes, too.

Added missing license header and Javadocs where necessary.
2015-07-06 12:30:16 +02:00
Oliver Gierke
c973582228 DATAREST-601 - Updated changelog. 2015-07-01 10:09:38 +02:00
Oliver Gierke
4c73f7d486 DATAREST-602 - Updated changelog. 2015-07-01 10:09:28 +02:00
Oliver Gierke
8786373b14 DATAREST-603 - After release cleanups. 2015-06-30 14:30:44 +02:00
Spring Buildmaster
14a2e9f464 DATAREST-603 - Prepare next development iteration. 2015-06-30 05:17:46 -07:00
Spring Buildmaster
f6142d9400 DATAREST-603 - Release version 2.3.1.RELEASE (Fowler SR1). 2015-06-30 05:17:44 -07:00
Oliver Gierke
a21a1f3fd2 DATAREST-454 - Reverted to usage of plain Strings for HTTP headers.
Spring 4.0.9 does not include the constants for HTTP headers whose usage was introduced in 46b08. Reverted to use the String equivalents.

Original pull request: #184.
2015-06-30 14:11:46 +02:00
Oliver Gierke
96bc074282 DATAREST-603 - Prepare 2.3.1.RELEASE (Fowler SR1). 2015-06-30 13:58:39 +02:00
Oliver Gierke
ed60172878 DATAREST-603 - Updated changelog. 2015-06-30 12:31:51 +02:00