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
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.
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
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.
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.
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.
* 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.
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.
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.
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.
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.
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.
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).
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.
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.