Upgraded to Groovy 2.4.4. Polished sample domain types and repositories. Removed obsolete format registration in test cases for schema creation. Keep inlined null checks to make sure the IDE doesn't create unnecessary can-be-null warnings.
Original pull request: #206.
Groovy-based objects inherit from GroovyObject. This brings along attributes that Spring Data REST may try to parse when generating metadata like JSON Schema. Also verify ALPS is supported.
We now exclude those artificial properties from being exposed in the schema as well as causing issues.
Original pull request: #206.
ProjectionResourceContentSerializer.unwrappingSerializer(…) now returns a new unwrapping instance instead of mutating the current instance to prevent the source one from answering subsequent calls to isUnwrappingSerializer() with true.
This allows the source instance to be reused and produce reliable results on multiple serialization attempts.
Related tickets: DATAREST-716.
Projection serializer now only creates a nested JSON document if it's not in unwrapping mode. Switched to a completely immutable implementation as we were previously mutating state in the request for an unwrapping instance as we were assuming the instances not being reused.
The Querydsl integration in RootResourceInformationHandlerMethodArgumentResolver now only kicks in if the controller method parameter is annotated with @QuerydslPredicate. This allows us to apply the QuerydslBindings for collection resources but make sure they aren't accidentally applied during executions of query methods etc.
Improved the type lookup for query method execution to make sure the correct mapping is looked up for collection parameters.
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 now explicitly skip non-Jackson-serializable properties from being rendered in the schema. This prevents exceptions in rare cases where the Jackson BeanPropertyDefinition is only backed by a setter.
The issue occurred with current Spring Data Gemfire as it considers a BigDecimal a PersistentEntity and then failed to produce a proper ResolvableProperty for setScale(…) as it's a setter-only property.
Related tickets: SGF-429.
We now use the following keys in the resource bundle to determine values for the title attribute of JSON schema property (in descending order of preference):
$fullyQualifiedClassName.$property._title
$simpleClassName.$property._title
$property._title
Also tweaked JsonProperty.format to make sure it always serializes as its toString() value.