Commit Graph

42 Commits

Author SHA1 Message Date
Mark Paluch
f5ae4c6498 Extend license header copyright years to 2025.
See #2446
2025-01-08 09:58:48 +01:00
Mark Paluch
ae851d878f Extend license header copyright years to 2024.
See #2349
2024-01-02 14:42:06 +01:00
Oliver Drotbohm
e4bca534bf Support to receive aggregate references as request parameters.
We now support using AggregateReference as type to bind request parameters taking URIs pointing to related aggregates. The default resolution will try to resolve the entire URI via UriToEntityConverter but one can also provide a function that can extract any part of the URI to be then resolved into either an identifier, aggregate instance or jMolecules Association against the ConversionService.

Fixes #2239.
2023-03-19 23:56:39 +01:00
Oliver Drotbohm
1bfa83cb73 Register per-repository pattern for observability purposes.
The standard Spring MVC observability integration registers the plain request pattern for observations. For our repository controllers that would result in one pattern registered for all individual repository resources (e.g. /{repository}/{id} etc.). However, the insights users would like to gain rather follows the individual repositories exposed. That's why we have so far exposed repository specific path pattern (/myrepo/{id}) via a custom request attribute. To adhere to the new observability integration of Spring Framework 6, we need to expose that particular pattern on the ServerRequestObservationContext, too.

Fixes #2212.
2023-01-09 15:31:57 +01:00
Mark Paluch
f0e86b9a17 Extend license header copyright years to 2023.
See #2211
2023-01-02 09:53:37 +01:00
John Blum
29b7305d71 Remove punctuation in Exception messages.
Closes #2152.
2022-06-08 16:08:03 -07:00
Oliver Drotbohm
b7d6b2b78c Update copyright years to 2022. 2022-02-07 10:26:46 +01:00
Jens Schauder
ee317f1b91 Remove Eclipse Non-Javadoc comments.
Closes #2093
2022-01-05 13:40:05 +01:00
Oliver Drotbohm
1828a6a2a7 Switch to JUnit 5.
Issue #2075.
2021-10-12 22:29:45 +02:00
Oliver Drotbohm
161a3a9499 Allow customization of LinkCollector.
LinkCollector is now an interface. The actual implementation has been moved to DefaultLinkCollector. RepositoryRestConfigurer now has a customizeLinkCollector(…) callback method to tweak or even completely replace the LinkCollector instance.

Fixes #2042.
2021-07-15 08:15:20 +02:00
Oliver Drotbohm
21ed68262f Properly handle associations in nested entities.
Nested entities that contain a reference to an aggregate root get a link to that attached to their representation. Previously, the creation of those links assumed that the reference is a materialized instance of the remote aggregate. That's now altered to be able to deal with associations, use identifiers directly or materialize to an intermediate aggregate instance to potentially use a custom lookup.
2021-04-07 20:07:53 +02:00
Mark Paluch
7afe7f1a9c Update copyright year to 2021.
Closes #1952
2021-01-12 11:45:16 +01:00
Oliver Drotbohm
0392103371 DATAREST-1545 - Polishing. 2020-09-15 17:13:53 +02:00
Oliver Drotbohm
d8c3394cd7 DATAREST-1470 - Switched to use factory methods of RepresentationModel types. 2020-01-14 14:51:18 +01:00
Mark Paluch
88f49da22f DATAREST-1467 - Update copyright years to 2020. 2020-01-07 09:02:59 +01:00
Oliver Drotbohm
9010a9d132 DATAREST-1458 - Fixed rendering of compact view to association resources.
The usage of text/uri-list as media type was entirely broken and not even advertised in the reference docs anymore. It's now again supported for both to-one and to-many associations via Collections. Maps are rejected as they cannot be rendered as list of URIs correctly. Updated reference documentation accordingly.

Added a custom MapModel implementation of RepresentationModel as apparently using Maps with EntityModel does not unwrap the content properly due to [0].

[0] https://github.com/FasterXML/jackson-databind/issues/171
2019-11-29 17:17:35 +01:00
Greg Turnquist
b016c0b125 DATAREST-1356 - Polishing. 2019-10-21 13:03:04 -05:00
Ľubomír Varga
202a8aa302 DATAREST-1356 - Fix updating single associations.
Correct a regression regarding association links. Introduce several test cases to prove this situation is fixed regarding PUTs for association links.

Source of the bug: 554d6cb27b (diff-1d7c16fe1992fef13a47fa8ab8599718L317) flips the criteria from "not single" to "single" without checking for related impacts.
2019-10-21 13:02:45 -05:00
Greg Turnquist
0b0ffab46b DATAREST-1421 - Polishing. 2019-08-08 10:54:53 -05:00
Greg Turnquist
9c56c3f217 DATAREST-1421 - Deprecate ALPS_JSON and ALPS_JSON_VALUE.
Instead, use Spring HATEAOS's MediaTypes.ALPS_JSON and ALPS_JSON_VALUE.
2019-08-08 10:54:45 -05:00
Oliver Drotbohm
244c57f712 DATAREST-1414 - Use I18N facilities of Spring HATEOAS more intensively.
We now rely on the MessageResolver capabilities of Spring HATEOAS to benefit of the optimizations in resource bundle resolution. Tweaked a couple of tests to make sure they properly use the resolver resorting to the default message the MessageResourceResolvable exposes.
2019-07-31 18:19:00 +02:00
Mark Paluch
19c261d7d0 DATAREST-1410 - Migrate remaining tests to AssertJ. 2019-07-31 10:06:03 +02:00
Oliver Drotbohm
82b928848b DATAREST-1373 - Upgrade to API changes in Spring HATEOAS 1.0 M2. 2019-05-08 19:49:58 +02:00
Spring Operator
3a0cba94a2 DATAREST-1351 - URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 1 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 395 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0.html with 1 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0.html ([https](https://www.apache.org/licenses/LICENSE-2.0.html) result 200).

Original Pull Request: #352
2019-03-22 10:51:57 +01:00
Oliver Drotbohm
d714d10675 DATAREST-1341 - Upgrade to latest API changes in Spring HATEOAS. 2019-03-04 11:42:58 +01:00
Oliver Drotbohm
1bf08180db DATAREST-1341 - Adapt to package refactorings in Spring HATEOAS. 2019-02-27 20:31:59 +01:00
Oliver Drotbohm
554d6cb27b DATAREST-1341 - Further API adaption for Spring HATEOAS 1.0. 2019-02-15 11:10:59 +01:00
Oliver Drotbohm
93b8e68bbf DATAREST-1341 - Move off of Java8PluginRegistry in favor of Spring Plugin's update one. 2019-02-07 20:55:42 +01:00
Greg Turnquist
af6f55a92c DATAREST-1341 - Upgrade to Spring HATEOAS 1.0. 2019-02-07 20:55:42 +01:00
Mark Paluch
68bfd55982 DATAREST-1330 - Update copyright years to 2019. 2019-01-08 11:47:37 +01:00
Oliver Gierke
a10aa934b7 DATAREST-1176 - Repository method exposure can now be controlled via RepositoryRestConfiguration.
The default exposure of repository methods is now controlled via RepositoryRestConfiguration.setExposeRepositoryMethodsByDefault(…). That allows us to remove the additional API from RepositoryDetectionStrategy as the mere detection is an orthogonal topic.

Also added RepositoryRestConfiguration.disableDefaultExposure() to set the RepositoryDetectionStategy to ANNOTATED and disables default method exposure in one go. That can be exposed via a Spring Boot configuration property downstream.
2018-01-18 18:41:07 +01:00
Mark Paluch
5d9dbf1823 DATAREST-1170 - Update copyright years to 2018. 2018-01-09 08:44:14 +01:00
Oliver Gierke
5836baaabf DATAREST-1105 - Polishing.
Simplified code a bit. Formatting. Adapted integration tests to make sure URI templates are always expanded.

Original pull request: #273.
2017-07-19 16:05:27 +02:00
Oliver Gierke
f906695e7a DATAREST-1064 - Adapt to API changes in repository interfaces.
Additional cleanups in QuerydslAwareRootResourceInformationHandlerMethodArgumentResolver to make sure a QuerydslRepositoryInvokerAdapter is only applied if the QuerydslPredicateBuilder actually exposes a predicate. Extracted a couple of methods to make sure the mapping pipeline reads nicely.
2017-05-03 18:10:27 +02:00
Oliver Gierke
b9957d1a6c DATAREST-1008 - Adapt to API changes in Spring Data Commons, Java 8 upgrades and Mockito 2.7. 2017-03-24 11:02:54 +01:00
Oliver Gierke
a13f51b49e DATAREST-1003 - Entity resources don't answer arbitrary JSON requests.
Previously, when a request was sending an Accept header of some arbitrary *+json, the request was routed through the controllers and might have ended up producing a PersistentEntityResource that was then mapped using an uncustomized Jackson ObjectMapper. That has caused a huge JSON object to be unfolded which is highly undesirable.

We now only answer JSON requests to repository resources that contain an Accept header with any of the explicit JSON media types we got registered.

Tweaked the setup of the ExceptionHandlerExceptionResolver to not expose a bean in the first place but rather use the Spring MVC provided callbacks to register custom ones. We also now make sure MVC is bootstrapped property for integration tests through the inclusion of DelegatingWebMvcConfiguration.
2017-03-01 21:39:51 +01:00
Mark Paluch
6bb989018c DATAREST-978 - Migrate ticket references in test code to Spring Framework style. 2017-01-13 10:09:53 +01:00
Craig Andrews
8149a02820 DATAREST-925 - Invoke ResourceProcessors for ProjectionResources.
The serializer for projection resources now also invokes ResourceProcessor instances registered for that particular projection.

Original pull request: #238.
2016-12-02 20:17:08 +01:00
Oliver Gierke
360ed8a9b2 DATAREST-892 - Fixed integration tests checking for HTTP Content-Type headers.
Spring 4.3 returns Content-Type headers including the character encoding. We needed to relax our assertions on the content type headers to only check for compatibility.
2016-09-09 22:53:42 +02:00
Oliver Gierke
9e5fd30c68 DATAREST-837 - Move to ResourceProcessor invcation infrastructure in Spring HATEOAS.
Deprecated the ResourceProcessor invoking infrastructure in place here in favor of the types moved to Spring HATEOAS. Refactored our codebase to make use of these newly introduced types right away.

Related tickets: spring-projects/spring-hateoas#362.
2016-06-10 21:33:33 +02:00
Oliver Gierke
6075f3052a DATAREST-782 - Fixed build after Spring 4.2.5 update.
Upgraded to JSONPath 1.1.0 as 0.9 is not supported with Spring 4.2 anymore. Tweaked integration tests due to changed semantics and internals of JSONPath >= 1.0.
2016-03-17 21:29:20 +01:00
Oliver Gierke
892409da2c DATAREST-774 - Separated integration tests from core project to avoid classpath overlap.
Extracted store specific tests into separate test modules to prevent classpath overlap between projects. Those tests are now executed in an "it" build profile to prevent the tests being packaged for distribution on release.

Use Map-based repositories and mapping contexts for test in the Core and WebMvc module.

Slightly changed the configuration API for lookup types on RepositoryRestConfiguration.

Related ticket: DATAREST-776.
2016-02-29 19:40:10 +01:00