Commit Graph

558 Commits

Author SHA1 Message Date
Greg L. Turnquist
73c73fa0db #1342 - Backport listing of community-led media types.
Include JSON:API and Siren implementations.

Original issue: #1337
2020-07-29 15:25:38 -05:00
Greg L. Turnquist
2f7a3024e2 #1338 - Backport the adjustment to ref docs about custom media types.
Custom media types do NOT require registering a MediaTypeConfigurationProvider implementation with spring.factories. The reference docs must be updated to illustrate this. Also add to the javadocs so users are properly warned.

Original issue: #1304
2020-07-28 15:04:31 -05:00
Oliver Drotbohm
d5b87615ac #1327 - Polishing. 2020-07-27 13:23:13 +02:00
Greg Turnquist
9ac8bae500 #1327 - Support alphanumeric logref for VndError.
According to https://github.com/blongden/vnd.error, logref is for "expressing a (numeric/alpha/alphanumeric) identifier". This patches `VndError` to support both strings and integers, ensuring each serializes properly.

NOTE: `VndErrors` has been deprecated due to the spec itself being dead since 2014. However, it must be supported until fully removed from Spring HATEOAS.

Backport of: #1291.
Original pull request: #1293.
2020-07-27 13:22:56 +02:00
Oliver Drotbohm
a166f41bf6 #1325 - Polishing.
Related ticket: #1314.
2020-07-24 09:00:34 +02:00
Oliver Drotbohm
6f9b1238be #1325 - HalLinkRelations now properly parses link relations with more than one colon.
Previously the parsing of link relations had assumed that a curie relation only consists of a single colon, thus, that a split by colon would always end up in two elements and only re-assembled these two elements. In case a URI that contains multiple colons handed into the parsing method, further segments had been dropped. We now remain everything following the first colon as local part of the URI.

Also, we now detect IANA registered URI schemes [0] and consider source relations starting with those as uncuried ones.

Related ticket: #1314.

[0] https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
2020-07-24 09:00:12 +02:00
Oliver Drotbohm
14a43ab2d8 #1324 - Fixed potential memory leak when creating many links.
We now avoid creating the UriTemplate instance for a Link if the Link does not contain curly braces in the first place. That allows us to remove the cache within UriTemplate in the first place.

Related tickets: #1287.
2020-07-23 22:56:03 +02:00
Greg L. Turnquist
c9209d56ed #1317 - Backporting the polishing of a test case.
Related issues: #1294.
2020-07-01 12:04:13 -05:00
Greg L. Turnquist
1450ad115f #1317 - Backport de-lomboking of production code.
Production code will no longer use Lombok. It's confined to test scope.

Related issue: #1294.
2020-07-01 12:03:36 -05:00
Greg L. Turnquist
70b5dc3c40 #1315 - Polishing.
Related issue: #1313.
2020-06-26 11:21:03 -05:00
Greg L. Turnquist
876e0518a4 #1315 - Backport fix for ExtendedProblem to 1.1.
When you use the withStatus() method on an ExtendedProblem, it hands back a Problem, which drops the payload. This commit adds the same sort of override already provided for the other attributes in ExtendedProblem.

Related issue: #1313.
2020-06-26 11:21:00 -05:00
Greg Turnquist
f92f965d5a #1292 - Update changelog.txt. 2020-05-11 16:06:21 -05:00
Oliver Drotbohm
5d1136ee12 #968 - Polishing.
Original pull request: #1269.
2020-05-07 22:19:28 +02:00
Réda Housni Alaoui
08c5f564b3 #968 - Consider @JsonUnwrapped properties with (embedded) CollectionModel and HAL Forms.
Original pull request: #1269.
2020-05-07 22:19:01 +02:00
Oliver Drotbohm
b865ad403b #864 - Polishing.
Consistently use javascript instead of json for JSON code blocks in the reference documentation.
2020-05-07 21:48:16 +02:00
Oliver Drotbohm
2cab91a332 #864 - Introduced HalModelBuilder.
HalModelBuilder expose HAL-idiomatic API to set up representations. That includes embeds, previews and syntactic sugar around the inclusion of potentially empty collections as embeds.

Related tickets: #175, #193, #270, #920.
Original pull request: #1273.
2020-05-07 21:32:57 +02:00
Oliver Drotbohm
36ddb281f9 #1280 - Fix in invocation of generic RepresentationModelProcessor. 2020-04-29 17:04:44 +02:00
Oliver Drotbohm
f8b4e07b9b #1278 - Update changelog. 2020-04-28 13:35:03 +02:00
Greg Turnquist
24a005abde #1275 - Align with Spring Framework naming convention for Kotlin co-routines.
* Deprecated existing `toCollectionModel` extension function using Kotlin's @Deprecated providing maximum ease for developers to migrate to new API.
* Added functions that create a full complement between ReactiveRepresentationModelAssemblerBuildDsl and SimpleReactiveRepresentationModelAssemblerBuildDsl on both `toModelAndAwait` and `toCollectionModelAndAwait`.

Related issue: #1213.
2020-04-22 13:20:37 -05:00
Greg Turnquist
90377a6e8d #227 - Verify UriTemplate reports variable parameter as "templated".
Resolved in a previous commit, this simply adds a test case verifying the regression doesn't happen.
2020-04-15 14:15:34 -05:00
Greg Turnquist
b46082b1b0 #1213 - Add support for Kotlin co-routines.
The ReactiveRepresentationModelAssembler and SimpleRepresentationModelAssembler both accept Flux inputs for entities. This change adds support for Kotlin co-routines to the same inputs.

Related pull request: #1258.
2020-04-07 11:50:20 -05:00
Oliver Drotbohm
1f8c0a4230 #1252 - Polishing.
We now make sure that BeanPostProcessors that are exposed consume their dependencies via ObjectFactory instances to avoid the need to prematurely trigger bean instantiation in the BeanPostProcessor detection phase. Marked the direct dependencies of the post processors as lazy, as the post processor only do actual work if beans of a particular type are available in the ApplicationContext. In case they aren't we don't even need to instantiate the downstream dependencies of the processors.

Avoid proxying of configuration classes where possible.

Related pull request: #1251.
2020-04-03 18:26:09 +02:00
Greg Turnquist
de38b9e200 #1252 - Make sure HypermediaWebTestClientConfigurer is only included with spring-test on the classpath.
HypermediaConfigurationImportSelector is now ResourceLoaderAware to make sure it uses the class loader used to bootstrap the application context. This is important for both testing as well as custom classloader arrangements like Boot's DevTools. We now only include WebTestHateoasConfiguration if WebTestClient is on the classpath.

The configuration class has been extracted to not leak references to code tied to spring-test into production deployments. Added test cases to check both the inclusion and exclusion of the configuration classes based on the classpath arrangement.

Original pull request: #1251.
2020-04-03 17:48:29 +02:00
Greg Turnquist
599a366c85 #1225 - Polishing. 2020-04-02 12:20:52 -05:00
Greg Turnquist
6a6cd31113 #1223 - Polishing. 2020-04-02 12:17:26 -05:00
Greg Turnquist
fae4cf0e68 #1224 - Polishing. 2020-04-02 12:15:44 -05:00
Greg Turnquist
600a975732 #1224 - Polishing. 2020-04-02 12:12:37 -05:00
Greg Turnquist
8dfa4d707f #1224 - Polishing. 2020-03-31 14:18:59 +02:00
Oliver Drotbohm
131ec70a6b #1244 - Update changelog. 2020-03-31 14:18:59 +02:00
Oliver Drotbohm
14f6375234 #1244 - Polishing.
Added missing license headers and a bit of formatting. Nullability annotations in HypermediaWebTestClientConfigurer.
2020-03-31 13:52:05 +02:00
Greg Turnquist
904a03a241 #1224 - Provide API for users to easily configure WebClient instances.
Introduce `HypermediaWebClientConfigurer` with a simple API that registers hypermedia types via `WebClient.Builder`.

Deprecate `WebClientConfigurer`, leveraging the new solution.

Update reference documentation showing how to use it, with and without Spring Boot.
2020-03-30 23:00:20 -05:00
Greg Turnquist
dea0001da2 #1223 - Provide API to configure RestTemplate with hypermedia.
Create a HypermediaRestTemplateConfigurer bean registered as a Spring HATEOAS bean.

Update reference documentation to show how to use it directly and with Spring Boot via RestTemplateCustomizer.
2020-03-30 22:20:27 -05:00
Greg Turnquist
4e697b899b #1225 - Polishing.
Appears one test case exerted a false positive. Fixing it exposed a gap and how to properly configure an existing WebTestClient (which is now in the reference docs).
2020-03-30 16:13:42 -05:00
Greg Turnquist
898752f0d5 #1225 - Provide implementation of WebTestClientConfigurer to support hypermedia registration.
Expand reference documentation to show ways to use it directly or via Spring Boot.
2020-03-30 12:23:07 -05:00
Oliver Drotbohm
6c09839cca #1241 - Additional factory methods for CollectionModel and PagedModel.
Added overloads of ….empty() to allow adding links right on construction.
2020-03-27 14:52:19 +01:00
Greg Turnquist
b5ee56a129 #1208 - Polishing. 2020-03-19 12:50:14 -05:00
Greg Turnquist
934ae0320f #1208 - Migrate from Lombok's experimental @Wither to @With.
Lombok has moved their "wither" annotation annotation out of experimental phase and replaced it with @With.
2020-03-18 12:13:04 -05:00
Greg Turnquist
48718bb180 #1216 - Polishing. 2020-03-12 12:05:24 -05:00
Vedran Pavic
3a2551072e #1216 - Provide String constants in IanaLinkRelations.
This commit adds String constants to IanaLinkRelations, so that IanaLinkRelations can be leveraged in places where compile time constants are required, such as Relation#itemRelation and Relation#collectionRelation.
2020-03-11 23:06:20 +01:00
Vedran Pavic
1f49360637 #1215 - Update RFC-5988 references to RFC-8288.
Update code, javadoc, and documentation changes.
2020-03-09 14:35:18 -05:00
Oliver Drotbohm
4b090108a9 #1199 - Update changelog. 2020-02-12 00:09:12 +01:00
Oliver Drotbohm
258f71611b #1193 - Polishing.
Prefer Spring WebFlux' CustomCodecs.registerWithDefaultConfig(…).

Original pull request: #1206.
2020-02-11 18:33:44 +01:00
Greg Turnquist
7ce980b6b7 #1193 - Revised usage of Spring Web Encoder APIs.
Spring Web has deprecated several Encoder/Decoder APIs and Spring HATEOAS must revise its usage.

Original pull request: #1206.
2020-02-11 18:33:27 +01:00
Oliver Drotbohm
c687e0a9c1 #1205 - Fix nullability warnings in EntityModelProcessorWrapper.isValueTypeMatch(…). 2020-02-11 18:12:32 +01:00
Oliver Drotbohm
6ff57dea4c #1204 - Fix nullability declarations of VndError.path.
The property and constructor arguments for it are now properly declared as nullable.
2020-02-11 18:10:56 +01:00
Oliver Drotbohm
1d18a9a8f7 #1202 - Polish imports and formatting. 2020-02-11 18:09:45 +01:00
Oliver Drotbohm
9a73194e1b #1201 - Switched to EntityModel factory methods where possible. 2020-02-11 18:08:34 +01:00
Oliver Drotbohm
290b58858a #1200 - Removed deprecation of Link.of(String, String). 2020-02-11 18:06:39 +01:00
Oliver Drotbohm
29479b82d9 #1198 - Moved of deprecated @Wither in favor of @With. 2020-02-11 18:05:34 +01:00
Oliver Drotbohm
79ed8ba798 #1189 - Polishing.
Switched to a less complicated implementation of the interface method parameter annotation lookup by using Spring's ClassUtils.getInterfaceMethodIfPossible(…).

Simplified test cases to pure unit test on the link builder APIs. We don't need to fully execute a complete MVC/WebFlux request/response cycle to verify the link creation to pick up the parameter annotations from the interfaces.

Original pull request: #1194.
2020-02-11 16:52:21 +01:00