Commit Graph

722 Commits

Author SHA1 Message Date
Oliver Gierke
2bed28842d DATAREST-902 - Fixed order depending DuplicateLinkListingTest.
We now use the explicit identifier of the person just created, not a fixed 1 as other tests might have used that identifier already and that entity is not available anymore as a transaction rollback occured in those tests.
2016-09-20 07:46:34 +02:00
Oliver Gierke
ec95f9e14f DATAREST-883 - Polishing.
Switched to use @RequiredArgsConstructor where possible. Slightly rearranged test cases. Inlined JacksonMappingAwareSortTranslator to not expose it as bean unless necessary. Use static Jackson BeanClassIntrospector to avoid unnecessary recreation.

Original pull request: #222.
2016-09-19 08:29:43 +02:00
Mark Paluch
c48050bfa1 DATAREST-883 - Consider Jackson field names in Sort mapping.
We now consider Jackson field names when resolving Sort arguments. Domain model properties annotated with @JsonProperty("sales") can be specified by their Jackson-mapped field name in sort arguments. Field names are mapped to their according persistent property names to be used in repository query method sorting. Unknown field names are silently dropped.

Original pull request: #222.
2016-09-19 08:15:38 +02:00
Oliver Gierke
129ea2a5e3 DATAREST-837 - DomainObjectMerger doesn't nullify read-only properties on PUT.
PUT requests are supposed to replace the state of the resource with the request payload. However, Spring Data REST already handles a couple of domain object propoerties in a special way as theri values map to dedicated HTTP features: identifiers (URIs), last-modified dates (header) etc.

For users, it might be worthwhile to exclude other properties from being set by applying the payload, like properties that are completely under the control of the server, e.g. creation user and date, last modifying user etc. So far, users didn't have any means to exclude those properties as the handling of PUT requests treated every missing property of the payload as null value.

DomainObjectMerger now checks whether a property is actually writable before applying the implicit null value. The application can be disabled by annotation a property with @ReadOnlyProperty.
2016-08-18 13:11:47 +02:00
Oliver Gierke
0cae0e5e70 DATAREST-863 - Adapt to changes in Accept header lookup in Spring 4.3.
Spring 4.3's HeaderContentNegotiationStrategy switched from looking up the Accept header via the method returning a single (potentially comma separated) one to the method returning multiple headers in the first place. We now added an override of HttpServletRequestWrapper.getHeaders(…) to out custom adapter defaulting the media type to make sure the defaulting is visible and thus the right handler methods are looked up.

That previously missing caused the DelegatingHandlerMapping selecting the redirect to the HAL browser in case a request to the API root was sent without an accept header as the defaulting of the header to application/hal+json wasn't properly exposed anymore and the redirect to the browser — declaring a produces clause of text/html — was not causing any media type mismatch anymore.
2016-08-04 21:15:33 -07:00
Oliver Gierke
f8806cc43a DATAREST-803 - Updated changelog. 2016-07-28 09:03:21 +02:00
Oliver Gierke
dbedcfff8c DATAREST-804 - Updated changelog. 2016-07-28 09:03:13 +02:00
Oliver Gierke
10436a0df7 DATAREST-847 - RepositoryEntityCotroller.saveAndReturn(…) now uses save result.
Previously we handed the original entity to the AfterSaveEvent. This should work in most cases but actually repositories are allowed to return a completely different instance so that we now hand over the instance returned by the repository interaction to avoid potentially occurring issues.
2016-07-01 14:45:24 +02:00
Oliver Gierke
954c49be89 DATAREST-815 - Tweaked HalBrowser controller implementation to consider proxied requests.
We now use the APIs in place in Spring MVC to make sure we create proper redirects for requests that carry proxy headers so that the redirect target is still going through the proxy.
2016-04-27 15:34:34 +02:00
Oliver Gierke
8d249b4b9c DATAREST-802 - Updated changelog. 2016-04-06 23:14:27 +02:00
Oliver Gierke
e8ad9b1541 DATAREST-790 - Updated changelog. 2016-04-06 18:44:38 +02:00
Massimo Mangoni
4d1d07f3e5 DATAREST-790 - Fixed typos in the reference documentation.
Original pull request: #203.
2016-04-06 13:26:31 +02:00
Oliver Gierke
29783fe23e DATAREST-720 - HAL Browser fragment now considers the context path if set.
Removed some obsolete Maven dependency versions along the way.
2016-04-01 13:00:09 +02:00
Oliver Gierke
877070a56f DATAREST-782 - Updated changelog. 2016-03-18 13:19:28 +01:00
Oliver Gierke
2557a2401a DATAREST-766 - After release cleanups. 2016-02-23 14:18:16 +01:00
Spring Buildmaster
8bb2143919 DATAREST-766 - Prepare next development iteration. 2016-02-23 05:26:21 -08:00
Spring Buildmaster
01661f9763 DATAREST-766 - Release version 2.4.4 (Gosling SR4). 2016-02-23 05:26:20 -08:00
Oliver Gierke
62ebf7ae72 DATAREST-766 - Prepare 2.4.4 (Gosling SR4). 2016-02-23 12:56:55 +01:00
Oliver Gierke
648d9cd8d5 DATAREST-766 - Updated changelog. 2016-02-23 12:56:47 +01:00
Oliver Gierke
685da6d4eb DATAREST-756 - Updated changelog. 2016-02-12 22:11:09 +01:00
Oliver Gierke
0995aea18b DATAREST-766 - Tweaked version properties for Gosling SR4. 2016-02-11 19:49:15 +01:00
Oliver Gierke
12d08bf159 DATAREST-754 - Polishing.
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.
2016-01-25 17:51:10 +01:00
Greg Turnquist
18cc22738c DATAREST-753 - Added support for Groovy-based domain objects.
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.
2016-01-25 17:51:10 +01:00
Oliver Gierke
3c411d1261 DATAREST-747 - ProjectionDefinitionConfiguration now returns the most concrete projection.
In case multiple projections are defined with a given name, we now return the projection defined for the most concrete type match.
2016-01-11 19:40:26 +01:00
Oliver Gierke
a8f271a67d DATAREST-743 - Made ProjectionResourceContentSerializer immutable.
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.
2016-01-07 21:46:38 +01:00
Oliver Gierke
a0a84c7959 DATAREST-731 - After release cleanups. 2015-12-18 10:26:34 +01:00
Spring Buildmaster
5b0110f2d0 DATAREST-731 - Prepare next development iteration. 2015-12-18 01:17:45 -08:00
Spring Buildmaster
3a495f9ce7 DATAREST-731 - Release version 2.4.2.RELEASE (Gosling SR2). 2015-12-18 01:17:44 -08:00
Oliver Gierke
f5b088d311 DATAREST-731 - Prepare 2.4.2.RELEASE (Gosling SR2). 2015-12-18 08:30:37 +01:00
Oliver Gierke
9d977a8c8c DATAREST-731 - Updated changelog. 2015-12-18 08:30:25 +01:00
Oliver Gierke
8c5bf9802f DATAREST-723 - PropertyMappings now get eagerly initialized.
Switched to eager initialization of PropertyMappings to avoid potential ConcurrentModificationException.
2015-12-16 16:02:23 +01:00
Oliver Gierke
5c1b731bfa DATAREST-729 - Removed relative reference to parent POM. 2015-12-13 16:21:15 +01:00
vtsukur
d449dd253d DATAREST-711 - Actualized examples with projection configuration and fixed typos.
Original pull request: #202.
2015-12-13 16:20:26 +01:00
Oliver Gierke
f7cff01d99 DATAREST-697 - Fixed unwrapping mode in ProjectionSerializer.
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.
2015-12-10 13:20:59 +01:00
Oliver Gierke
66f0a6d9f2 DATAREST-712 - Fixed Querydsl setup.
We accidentally backported the groupId of Querydsl 4 into the bugfix branch. This is now reverted back to the 3.x groupId.
2015-11-25 16:44:47 +01:00
Oliver Gierke
c5263eabf5 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:08 +01:00
Oliver Gierke
937ef6d9af DATAREST-712 - Fixed application of Querydsl bindings to only kick in for collection resources.
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.
2015-11-24 15:36:22 +01:00
Oliver Gierke
2d1fe6fe87 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:25 +01:00
Oliver Gierke
515bee79fe DATAREST-707 - After release cleanups. 2015-11-19 12:34:06 +01:00
Spring Buildmaster
45a00b55ba DATAREST-707 - Prepare next development iteration. 2015-11-15 06:30:45 -08:00
Spring Buildmaster
89a39035f2 DATAREST-707 - Release version 2.4.1.RELEASE (Gosling SR1). 2015-11-15 06:30:43 -08:00
Oliver Gierke
6fb2a60d09 DATAREST-707 - Prepare 2.4.1.RELEASE (Gosling SR1). 2015-11-15 14:06:55 +01:00
Oliver Gierke
87e2e825dd DATAREST-707 - Updated changelog. 2015-11-15 14:06:51 +01:00
Oliver Gierke
44e67b4aec DATAREST-706 - Added unit test for fixed functionality.
Original pull request: #200.
2015-11-13 17:35:07 +01:00
Artur M
968139909f DATAREST-706 - RepositoryExceptionHandler.handleMiscFailures(…) now passes exception instead of null.
Original pull request: #200.
2015-11-13 17:35:07 +01:00
Oliver Gierke
76f853ec03 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:42 +01:00
Oliver Gierke
bb612e0ea0 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:36:53 +01:00
Oliver Gierke
3a6b9ea3ff 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:36:47 +01:00
Oliver Gierke
35a86f7656 DATAREST-683 - Enum values are now correctly i18ned in ALPS.
If enum translation is enabled, ALPS descriptors now expose the translated values correctly.
2015-11-06 16:36:43 +01:00
Oliver Gierke
cc7bc7aa79 DATAREST-683 - ALPS documents are now correctly nested.
We now wrap the ALPS descriptors into a root ALPS JSON node.
2015-11-06 16:36:39 +01:00