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.
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.
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.
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.
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.
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.
PATCH requests to non existing resource now correctly return 404 Not Found as PersistentEntityResourceHandlerMethodArgumentResolver.read(…) now correctly throws the ResourceNotFoundException.
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.
Moved just introduced test case into PersistentEntityToJsonSchemaConverterUnitTests. Added ticket reference. Removed obsolete test case.
Original pull request: #190.
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.
Simplified implementation change. Integrated new test case into the existing one. Cleaned up existing test case to always use TestMvcClient.
Original pull request: #189.
The ALPS metadata exposed now considers the id exposure configuration to decide whether to skip the identifier property or not.
Original pull request: #189.
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.
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.
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.
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.
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.
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.
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.