740 Commits

Author SHA1 Message Date
Oliver Drotbohm
5d88b50327 #1288 - Polishing.
Original ticket: #968.
Original pull request: #1269.
2020-05-07 22:24:12 +02:00
Réda Housni Alaoui
5f1d5a8027 #1288 - Consider @JsonUnwrapped properties with (embedded) CollectionModel and HAL Forms.
Original ticket: #968.
Original pull request: #1269.
2020-05-07 22:23:55 +02:00
Oliver Drotbohm
e1f751caf1 #1281 - Fix in invocation of generic RepresentationModelProcessor. 2020-04-29 17:20:16 +02:00
Oliver Drotbohm
962b9a03ec #1279 - Continue development on 1.0.6.BUILD-SNAPSHOT. 2020-04-28 13:08:50 +02:00
Oliver Drotbohm
761a154b4a #1279 - Releasing Spring HATEOAS 1.0.5.RELEASE. 2020-04-28 13:08:48 +02:00
Oliver Drotbohm
96b87ebb91 #1279 - Prepare changelog. 2020-04-28 13:03:51 +02:00
Oliver Drotbohm
483303fa1f #1279 - Dependency upgrades prior to release. 2020-04-28 13:01:06 +02:00
Patrick ALLAIN
164c10d353 #1272 - Add Kotlin source to released artifacts.
Original issue: #1270.
Original pull request: #1271.
2020-04-14 11:24:14 -05:00
Greg Turnquist
b11ae7cbf8 #1267 - Use JDK 14 for Java.NEXT CI testing. 2020-04-09 13:02:05 -05:00
Oliver Drotbohm
b6ebe37f25 #1263 - Remove .factorypath. 2020-04-09 13:14:30 +02:00
Oliver Drotbohm
1af150b0bd #1262 - Upgrade to Spring Docs resources 0.2.1.
For improved content width.
2020-04-09 13:14:30 +02:00
Jay Bryant
d991c6900e #1262 - Update spring-doc-resources and syntax highlighting for ref docs.
Update spring-doc-resources to get the latest look and feel and nicer code listings.
2020-04-09 13:14:30 +02:00
Greg Turnquist
df03698fe5 #1236 - Continue development on 1.0.5.BUILD-SNAPSHOT. 2020-03-24 10:56:24 -05:00
Greg Turnquist
53f6aade50 #1236 - Releasing Spring HATEOAS 1.0.4.RELEASE. 2020-03-24 10:56:21 -05:00
Greg Turnquist
ae3655ca2b #1236 - Update changelog to reflect 1.0.4.RELEASE changes. 2020-03-24 10:55:32 -05:00
Greg Turnquist
cf3e39f10c #1235 - Backport upgrading to Jackson 2.10.3. 2020-03-24 10:45:27 -05:00
Greg Turnquist
f281afe1a7 #1234 - Backport upgrading to Reactor Dysprosium-SR6. 2020-03-24 10:45:05 -05:00
Greg Turnquist
22ac56afc1 #1233 - Backport fixing CI scripts so they use maven caching.
By having the JAVA_HOME path match the Jenkins volume mount point, maven caching should now work properly and speed up CI building and testing.
2020-03-24 10:44:42 -05:00
Greg Turnquist
e9218e3e1c #1232 - Backport upgrading to JUnit 5.6.1. 2020-03-24 10:44:16 -05:00
Greg Turnquist
b6b2397946 #1231 - Backport upgrading to Spring Framework 5.2.5.RELEASE. 2020-03-24 10:43:38 -05:00
Greg Turnquist
c993650751 #1220 - Polishing.
Original issue: #1216
2020-03-12 12:10:46 -05:00
Vedran Pavic
25bc02c548 #1220 - Backport String constants for 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.

Original issue: #1216
2020-03-12 12:10:26 -05:00
Vedran Pavic
f0abb4d847 #1217 - Backport migration from RFC-5988 to RFC-8288.
Update code, javadoc, and documentation changes.

Original: #1215
2020-03-09 16:59:28 -05:00
Oliver Drotbohm
ee42421544 #1207 - Fix nullability warnings in EntityModelProcessorWrapper.isValueTypeMatch(…).
Back-port of: #1205.
2020-02-11 18:20:27 +01:00
Oliver Drotbohm
f973afedd8 #1197 - 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 17:01:01 +01:00
Greg Turnquist
2919d60c46 #1197 - Look for web annotations in interfaces.
When forming links, look at a controller class's interface definitions for possible Spring Web annotations.

Related issues: spring-projects/spring-framework#15682
Original pull request: #1194.
2020-02-11 17:00:49 +01:00
Greg Turnquist
a044ac0de9 #1196 - Upgrade to Jackson 2.10.2.20200130.
Backport the Jackson upgrade to 1.0.x.
2020-02-10 17:50:15 -06:00
Greg Turnquist
1b5a344aad #1191 - Backport @ExposesResourceFor into the migration script.
Related issue: #1183
2020-02-05 16:00:59 -06:00
Roland Krüger
d922d6f74c #1190 - Fix typos, document links, and grammatical errors.
Unfinished sentences were marked with ellipsis….
2020-02-03 13:46:35 +01:00
Oliver Drotbohm
09c1baecc9 #1185 - Continue development on 1.0.4.BUILD-SNAPSHOT. 2020-01-15 09:29:09 +01:00
Oliver Drotbohm
0b1999052a #1185 - Releasing Spring HATEOAS 1.0.3.RELEASE. 2020-01-15 09:29:07 +01:00
Oliver Drotbohm
167a36848c #1185 - Update changelog. 2020-01-15 09:28:15 +01:00
Oliver Drotbohm
27b21c8f19 #1184 - Backport dependency upgrades from 1.1.
Backports of:

#1174 - Upgrade to Spring Framework 5.2.3.
#1178 - Upgrade to Jackson 2.10.2.
#1179 - Upgrade to Kotlin 1.3.61.
#1180 - Upgrade to Slf4J 1.7.30.
#1181 - Upgrade to Reactor Dysprosium SR3.
#1182 - Upgrade to JUnit 5.5.2.
2020-01-15 09:24:05 +01:00
Oliver Drotbohm
913ba151b9 #1171 - Fix for potential NullPointerException in UriTemplate.
UriTemplate.with(TemplateVariable) now properly forwards the UriBuilderFactory from the current instance.

Backport of: #1165.
2020-01-14 14:02:56 +01:00
Oliver Drotbohm
3943014ad8 #1170 - Update copyright years to 2020. 2020-01-10 12:29:07 +01:00
Oliver Drotbohm
0fe5bde3fe #1167 - Fix premature initialization of downstream dependencies of WebConverters.
RestTemplateHateoasConfiguration is a BeanPostProcessor and previously used a direct reference to WebConverters which caused downstream dependencies to be initialized once Spring Framework looks up BeanPostProcessors. This renders all of those dependencies ineligible of being post-processed by other BeanPostProcessors in turn.

This is now fixed by using an ObjectProvider<WebConverters> from within RestTemplateHateoasConfiguration instead, so that the initialization is delayed until the processing of the first bean is triggered.

Backport of: #1166.
2020-01-06 22:00:08 +01:00
Oliver Drotbohm
1b16157c09 #1158 - Fixed custom EntityModel serialization for Map payloads.
Using a custom serializer seems to break downstream projects that also register serializers for EntityModel. We're now using extra methods on EntityModel itself that do the trick as well.
2019-12-12 11:15:32 +01:00
Oliver Drotbohm
d1204f3aa1 #1158 - Tweaks to EntityModel to allow deserialization with Map<String, Object> content.
We now keep internal methods in EntityModel that are configured using Jackson annotations so that it'd populate the content with a Map in case Map<String, Content> is defined as payload type.
2019-12-11 18:59:46 +01:00
Oliver Drotbohm
3b18df355f #1158 - Register custom serializers to handle Map based EntityModel instances.
We now register a custom serializer to massage EntityModel instances into dedicated types that – in case of a Map being the content of the entity model – wrap the model into a type that applies the necessary Jackson tweaks to properly unwrap a Map.
2019-12-11 09:41:29 +01:00
Oliver Drotbohm
eab124718b #1156 - Fixed thread-safety issues in AnnotationLinkRelationProvider.
We now use a ConcurrentReferenceHashMap to cache annotation lookups in AnnotationLinkRelationProvider to avoid thread-safety issues.
2019-12-10 15:29:47 +01:00
Oliver Drotbohm
93b6076f5b #1145 - WebFlux Link creation starts with clean query parameters.
We now explicitly remove all query parameters from the base URI we use when creating links from method names.
2019-12-09 16:00:36 +01:00
Oliver Drotbohm
e51a7f7a28 #1151 - Make sure we explicitly expose all media type model properties.
Jackson can be configured to not auto-detect properties on objects to be rendered, requiring them to be explicitly annotated with @JsonProperty to be exposed. In such a configuration setup, some of our model types do not work properly as so far we have expected public properties to be included automatically.

This commit changes that to explicitly include @JsonProperty on all of the getter methods exposed.
2019-12-09 12:17:23 +01:00
Oliver Drotbohm
285af0c7e4 #1153 - WebFluxLinkBuilder now considers the requests context path.
The base URI we create now consists of the requests root URI plus the context path concatenated. On actual UriComponentsBuilder creation we then simply append the path discovered from the method mapping.
2019-12-09 12:17:20 +01:00
Oliver Drotbohm
12ca3d4fbf #1149 - Restore backward compatibility in LinkBuilderSupport.
Reintroduced callback methods that existing implementations of LinkBuilderSupport will have implemented in deprecated form indicating removal for 1.1.
2019-12-09 10:43:35 +01:00
Oliver Drotbohm
6475e6751f #1149 - Further performance improvements in link creation.
The implementation details of WebHandler have been significantly refactored to rather work with structures that allow better cacheability by clearly separating abstractions over the statically available information from the per-invocation aspects. This results in a new HandlerMethodParameter(s) abstraction within WebHandler. BoundMethodParameter has been removed entirely. HandlerMethodParameters are create once then cached for every controller method being linked to.

DummyInvocationUtils now creates a ThreadLocal cache of the proxies created for calls to methodOn(…) as they essentially only act as basis for subsequent calls to the methods on the proxy created which in turn are expected to be handed into a linkTo(…) call which obtains the invocation right away. This avoids overhead in cases methodOn(…) is called multiple times for the same controller from a single controller.

The lookup of the LastInvocationAware was previously routed through the proxy, handled by InvocationRecordingMethodInterceptor. This resulted in a second, reflective call for every link creation. DummyInvocationUtils now provides a dedicated lookup method as it knows about the structure of the proxy it created and thus can unfold the recorded invocation more effectively.

The LinkBuilder type hierarchy now works with UriComponents and only creates a UriComponentsBuilder if it needs to modify the backing link in the first place. This avoids superfluous back and forth between UriComponents and UriComponentsBuilders that involved quite a bit of String parsing and creation.

EncodingUtils now starts from a StandardCharsets.UTF_8 to avoid repeated Charset creation.

The changes result in a ~3x performance compared to 1.0.2.RELEASE:

1.0.2.RELEASE

Benchmark                                         Mode  Cnt         Score        Error  Units
ControllerLinkBuilderBenchmark.noLinkCreation    thrpt   10  39004583,189 ± 751668,181  ops/s
ControllerLinkBuilderBenchmark.pureLinkCreation  thrpt   10     43443,133 ±    783,120  ops/s
ControllerLinkBuilderBenchmark.withLinkCreation  thrpt   10     60201,629 ±   1292,179  ops/s

1.1 / 1.0.3 SNAPSHOT

Benchmark                                         Mode  Cnt         Score        Error  Units
ControllerLinkBuilderBenchmark.noLinkCreation    thrpt   10  39618560,950 ± 612794,310  ops/s
ControllerLinkBuilderBenchmark.pureLinkCreation  thrpt   10    121700,634 ±   1510,415  ops/s
ControllerLinkBuilderBenchmark.withLinkCreation  thrpt   10    121982,085 ±   3344,206  ops/s

noLinkCreation - creates a single RepresentationModel instance but adds no links
pureLinkCreation - creates a single link pointing to a controller method
withLinkCreation - creates a single RepresentationModel instance adding a single link
2019-12-09 08:53:36 +01:00
Greg Turnquist
f3b1899197 #1142 - Continue development on 1.0.3.BUILD-SNAPSHOT. 2019-12-03 09:47:55 -06:00
Greg Turnquist
a636c22715 #1142 - Releasing Spring HATEOAS 1.0.2.RELEASE. 2019-12-03 09:47:53 -06:00
Greg Turnquist
9cacf46bde #1142 - Update CHANGELOG for 1.0.2.RELEASE. 2019-12-03 09:47:23 -06:00
Greg Turnquist
99cb3fee44 #1139 - Polishing. 2019-12-03 09:03:08 -06:00
Oliver Drotbohm
9fcc3fece8 #1140 - Forward global codec settings to decoders in WebClientConfigurer.
We now use new API introduced in Spring Framework 5.2.2 to forward the global configuration settings into the hypermedia decoders we register.
2019-12-03 14:34:32 +01:00