Commit Graph

473 Commits

Author SHA1 Message Date
Oliver Drotbohm
aea4c4c91f #811 - Added ability to override single link render mode per link relation.
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.
2019-02-21 16:46:53 +01:00
Greg Turnquist
943e9afc08 #728 - Update Kotlin DSLs to use WebMvcLinkBuilder. 2019-02-21 12:27:51 +01:00
Oliver Drotbohm
e82d42f45a #728 - Polishing. 2019-02-21 12:27:51 +01:00
Oliver Drotbohm
1d9703abbe #728 - API polishing.
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.
2019-02-21 12:27:51 +01:00
Oliver Drotbohm
576274c1b2 #728 - Fix dependency cycles in WebFlux / WebMVC code
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.
2019-02-21 12:27:51 +01:00
Oliver Drotbohm
68c605c7ff #728 - Polishing.
Adapt to API changes in master branch. Fixed formatting.
2019-02-21 12:27:51 +01:00
Greg Turnquist
3f0dcc7cb4 #728 - Add support for Spring WebFlux.
* 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.
2019-02-21 12:27:51 +01:00
Oliver Drotbohm
0ec193fa26 #798 - Polishing.
Switched to javadoc:javadoc goal as we're not an aggregator project and can prevent the lifecycle restart from being triggered which caused plugins being bound to lifecycle phases before compile to be re-triggered.

Upgraded to Asciidoctor Maven Plugin 1.5.7.1.
2019-02-21 09:52:38 +01:00
Oliver Drotbohm
544d7cd9ff #749 - Polishing. 2019-02-20 22:55:56 +01:00
Oliver Drotbohm
112479c499 #749 - Improve performance in Link building.
Introduced more aggressive caching of request mappings and UriTemplates based on the contribution on 0.25.x.
2019-02-20 22:55:48 +01:00
Oliver Drotbohm
926bf55339 #825 - Polishing.
Added StringLinkRelation.hashCode() to be consistent with ….equals(…).

Original pull request: #826.
2019-02-20 17:33:36 +01:00
Greg Turnquist
19036880b4 #825 - Comply with RFC8288 for LinkRelation matching.
Added several tests to ensure compliance with RFC8288.

Original pull request: #826.
2019-02-20 17:33:02 +01:00
Oliver Drotbohm
9131a82b90 #808 - Removed build setup after Spring 5.1 upgrade. 2019-02-15 11:46:46 +01:00
Greg Turnquist
e74d1098cc #808 - Remove Forwarded handling.
In light of upgrading to Spring Framework 5.1, no longer need custom handling of Forwarded headers.

Original pull request: #818.
2019-02-15 11:21:39 +01:00
Oliver Drotbohm
9e5db1874e #812 - General overhaul and refactorings.
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.
2019-02-15 10:57:23 +01:00
Oliver Drotbohm
38b98af786 #819 - Polishing.
Original pull request: #820.
2019-02-15 10:53:20 +01:00
Greg Turnquist
14f0012aef #819 - Migrate off deprecated OrderAwarePluginRegistry APIs.
Original pull request: #820.
2019-02-15 10:52:50 +01:00
Oliver Drotbohm
ee12040f10 #813 - Upgrade to Kotlin 1.3.21. 2019-02-14 19:20:35 +01:00
Oliver Drotbohm
eb78f47e4f #808 - Upgrade to Spring Framework 5.1.5. 2019-02-14 19:20:17 +01:00
Greg Turnquist
a447d2b5ce #804 - Polishing. 2019-02-11 12:42:46 -06:00
Oliver Drotbohm
baa2ca7d24 #807 - Removed console output from UberWebMvcIntegrationTest. 2019-02-11 14:59:17 +01:00
Oliver Drotbohm
f830d3d641 #806 - Polishing. 2019-02-11 14:57:31 +01:00
Oliver Drotbohm
aca2cc578a #806 - Fixed package cycle between hateoas and hateoas.core packages.
Moved AffordanceModelFactory to the library's root package. Moved Kotlin extensions to hateoas.mvc package.

Added an ArchUnit based test for package cycles.
2019-02-11 14:57:25 +01:00
Oliver Drotbohm
e794bf873a #805 - Polishing.
Whitespace.
2019-02-11 10:41:49 +01:00
Oliver Drotbohm
1dea5f61b9 #805 - Added Links.getRequiredLink(…). 2019-02-11 10:41:49 +01:00
Greg Turnquist
a9bae74dcf #793 - Switch from @Order to Ordered. 2019-02-07 16:44:42 -06:00
Oliver Drotbohm
ca72790b4b #804 - Avoid log output in MultiMediaTypeWebMvcIntegrationTests. 2019-02-07 20:21:41 +01:00
Oliver Drotbohm
c0903cb33e #803 - Polishing.
Method reordering. Whitespace.
2019-02-07 20:13:23 +01:00
Oliver Drotbohm
df6e1e5989 #803 - Removed reflective bridging between JSONPath 0.9 and 1.0.
We're on JSONPath 2.2 already.
2019-02-07 20:12:21 +01:00
Greg Turnquist
9e8e57a74b #787 - Return all Link attributes on discovery. 2019-02-07 11:42:08 -06:00
Greg Turnquist
9518a2db9a #791 - Add 'name' property to Link. (#801) 2019-02-07 08:13:49 -06:00
Greg Turnquist
9590d1f9ef #798 - Polishing. 2019-02-06 10:31:52 -06:00
Jay Bryant
a483daab6d #798 - Modernize documentation production and appearance.
Applied new convention standard for generating documentation using spring-doc-resources.
2019-02-06 10:26:48 -06:00
Jay Bryant
952422b4e5 #797 - Editing pass of the reference documents.
I edited for spelling, punctuation, grammar, usage, and corporate voice.
2019-02-05 11:15:13 -06:00
Oliver Drotbohm
c16ac486e4 #792 - Upgrade to Jackson 2.9.8. 2019-01-29 16:51:34 +01:00
Greg Turnquist
f420b5b258 #788 - Migrate edge release from JDK 12 to JDK 13. 2019-01-23 14:11:50 -06:00
Jens Schauder
9f4f1ad79b #788 - Fixed obvious warning in all touched files.
* Fixed assertions.
* Removed superfluous code.
* Simplified generics.
* Formatting.
2019-01-23 13:59:21 -06:00
Greg Turnquist
4081e58a1f #788 - Switch to IanaLinkRelations internally. 2019-01-18 12:19:25 -06:00
Greg Turnquist
0f696dd637 #788 - Remove redundant generics. 2019-01-18 12:03:45 -06:00
Greg Turnquist
74647cb5b1 #788 - Unify line endings. 2019-01-18 11:38:28 -06:00
Greg Turnquist
5725794a8e #788 - Remove redundant constructs, pre-Java 8 cruft, and superfluous exceptions. 2019-01-18 11:38:19 -06:00
Greg Turnquist
e9074c5d52 #784 - Polishing.
* Formatting.
* Copyright headers.
* Unused/unneeded methods.
2019-01-15 12:12:05 -06:00
Jens Schauder
b7a1c06f79 #784 - Polishing.
* Formatting.
* Extracted conversion methods.
* Tested and fixed NPE with empty pojo.
* Tested and fixed NPE with empty page meta data.
2019-01-15 12:10:47 -06:00
Greg Turnquist
8da3a851ce #784 - Introduce UBER+JSON mediatype.
Based on https://rawgit.com/uber-hypermedia/specification/master/uber-hypermedia.html.
2019-01-09 14:33:41 -06:00
Greg Turnquist
820f66179f #707 - Refactor Affordances to better support Spring Data REST.
* 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.
2019-01-07 14:08:42 -06:00
Greg Turnquist
2e7eabdc1a #778 - Introduce LinkRelation and enumerated IANA types.
Include IANA registry text and link to related standard for each link relation.
2019-01-04 12:42:32 -06:00
Kulcsár Roland
9c5d10aa07 #715 - Add link and affordance DSLs to help write idiomatic Kotlin code.
* Provide a LinkBuilderDsl for help create links.
* Provider an AffordanceBuilderDsl to help create affordances.
2019-01-02 13:31:23 -06:00
Greg Turnquist
26c9a3d71e #483 - Polishing.
Since we can't guarantee the incoming Map is <String,Object>, should only cast as <Object,Object> and use `.toString()` for maximum flexibility.
2018-12-21 08:43:21 -06:00
JamesE Richardson
8ced6c5154 #483 - Add composite field support to UriTemplate.
* 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
2018-12-20 20:27:56 -06:00
Jens Schauder
2882e82ba4 #572 - Polishing.
Removed redundant asserts.
2018-12-19 11:36:44 -06:00