The introduced methods allow clients to pass an identifier extractor function. Also introduced a new (Extended)TypedEntityLinks that exposes the same functionality as EntityLinks but with a shared identifier extractor function so that clients don't have to provide it for each method invocation.
Prepares the fix for #842.
Introduced findRequiredLinkWithRel(…) methods on LinkDiscoverer to delegate to existing lookups but resolving the Optional into an IllegalArgumentException.
Fixed JsonPathLinkDiscoverer to return no links at all if a required path segment in the payload cannot be found which would have triggered a PathNotFoundException before.
Polished parameter names and JavaDoc. Moved base test cases into the right packages.
The BeanPostProcessor implementations in (WebMVC|WebFlux)HateoasConfiguration are now declared as static methods and their dependencies use ObjectProvider wrapper types to prevent the need to prematurely initialize the entire configuration class which triggered the creation of a lot of downstream dependencies which were then reported as ineligible for post processing themselves.
Changed the package structure to better reflect the different modules of the library. All client related code now lives in the client package, server related APIs in server with their respective WebMVC and WebFlux implementations in sub-packages.
Added migration script to allow users to easily migrate to the new structure and added reference documentation section on the migration.
Traversons built in defaulting to HAL HttpMessageConverters and LinkDiscoverer implementation now caused a cyclic relationship between the client and mediatype.hal packages. This has be fixed by looking up the defaults via a SpringFactories interface.
We now expose a MediaTypeConfigurationProvider SPI interface that media type implementations can register an implementation class for in META-INF/spring.factories. The implementation class then has to provide a root Spring configuration class to be included into the bootstrap and expose whether it's supposed to be included for a given set of media types.
Configuration classes are supposed to implement HypermediaMappingInformation to expose either a Jackson module or code to configure the Jackson ObjectMapper to be used in the mapping infrastructure of the supported web stacks (WebMVC and WebFlux).
HalConfiguration now exposes a withSingleLinkRenderModeFor(…) taking a path pattern to be rendered in the also given RenderSingleLinks mode. It takes patterns as link relations are either plain strings or valid URIs.
Simplified HAL link list rendering in Jackson2HalModule avoiding double nesting of collections before rendering.
Renamed LinkBuilder implementations for the different web stacks Web(MVC|Flux)LinkBuilder for symmetry. Introduced dedicated builder types to be used from WebFluxLinkBuilder to more conveniently integrate with reactive flows (see the changes in WebFluxEmployeeController).
Deprecated ControllerLinkBuilder(Factory) in favor of WebMvcLinkBuilder(Factory).
Generally untangled the use of WebMvcLinkBuilder from the reactive examples.
WebHandler is now independent of a particular web stack as the final LinkBuilder creation is externalized through a SAM type that client code now uses to pass a constructor. Refactored the ReactiveLinkBuilder to avoid a dependency on ControllerLinkBuilder (read: the WebMVC stack). With that change, WebHandler is now moved back to the core package.
Refactored LinkBuilderSupport to keep a UriComponentsBuilder instance around instead of UriComponents. It creates a defensive copy of the builder instance on state modifying invocations and returns a new LinkBuilderSupport instance.
Moved SpringMvcAffordanceBuilder to the core package and removed Mvc segment from its name to make obvious it's not tied to SpringMVC. Introduced TemplateVariableAwareLinkBuilderSupport as common base class between ControllerLinkBuilder and ReactiveLinkBuilder. It extracts the TemplateVariable behavior from ControllerLinkBuilder.
Extracted import of web stack specific configuration into dedicated ImportSelector and make use of String based class names to avoid cyclic dependencies between the config packages.
Removed BasicLinkBuilder.
* Render hypermedia from WebFlux controllers.
* Support consuming hypermedia through WebClient.
* Support link creation reactively with a custom filter and explicitly with a user-provided ServerWebExchange.
* Add a ReactiveResourceAssembler and SimpleReactiveResourceAssembler.
* Upgrade to Spring Framework 5.2 to align with Spring Data Moore, removing specialized Forwarded header handling.
Cleanups in Affordance API and implementations of hypermedia type (de)serializers. Added a lot more domain methods and types to Link, ResourceSupport etc. to be able to move a lot of representation building logic into those.
AffordanceModelFactory is not a Spring Plugin anymore as that functionality is not needed currently as we statically look up all factories via the SpringFactoriesLoader mechanism.
Redesigned LinkRelation to become a first class abstraction in the codebase. IanaLinkRelations is now a collection of constants. Link now keeps a LinkRelation instance around instead of a plain String.
Tweaked LinkDiscoverer API to return Optional and Links instead of nullable Link and List<Link>.
Tweaked API of CurieProvider to make use of the newly introduced HalLinkRelation based on the general LinkRelation.
Additional fixes for the Kotlin extension functions. Make Kotlin build setup compile with JDK 8. Removed Objects helper class in favor of Spring's already existing Assert and it's usage in ResourceAssemblerSupport.
Moved AffordanceModelFactory to the library's root package. Moved Kotlin extensions to hateoas.mvc package.
Added an ArchUnit based test for package cycles.
* Move Spring MVC method scanning out of the core Affordances API and into SpringMvcAffordanceBuilder to make it easy to use in Spring Data REST (where method scanning isn't needed).
* Also push attributes from Affordance into AffordanceModel to centralize the details.
* Certain serializers must be registered differently due to Jackson's rules of precedence given Spring Data REST needs to override them.
* Added Tests to demonstrate required functionality.
* Expanding variables correctly to meet RFC spec. Composite values can be expanded either as a list or as an associative array
Also see https://tools.ietf.org/html/rfc6570#section-2.4.2
To avoid confusion about what to return on a Spring MVC endpoint, change toResources to not return `List<D>`, but instead `Resources<D>`. This clearly ensures when used to construct Spring MVC endpoints, will return a type Spring HATEOAS will properly marshal.
To support people that have already built apps on top of Lists, include a `toList<D>` method that honors the old contract.
Related issues: #493
Related pull requests: #572
In HAL-based documents (HAL and HAL-FORMS), the "templated" property must be ignored in LinkMixin, because that's where it is applied. Removes the need for a no-op `setTemplated` method in Link.
* Test cases drafted for both HAL an HAL-FORMS to verify proper behavior.
* Jackson2HalFormsIntegrationTest migrated from Hamcrest to AssertJ assertions.
Related pull requests: #668
* Moved compilation of Regexp patterns out of methods in order to not repeat it over and over again.
* Applied soft assertions where multiple assertions where used where one failure didn't guarantee the failure of all other assertions.
* Minor formatting.