Commit Graph

919 Commits

Author SHA1 Message Date
Oliver Drotbohm
7ff383b51c #1489 - Adapt changelog after 1.3 M3 release. 2021-03-25 16:46:42 +01:00
Oliver Drotbohm
065435280b #1489 - Continue development on 1.3.0-SNAPSHOT. 2021-03-16 10:33:23 +01:00
Oliver Drotbohm
01f471923e #1489 - Releasing Spring HATEOAS 1.3.0-M3. 2021-03-16 10:33:12 +01:00
Oliver Drotbohm
27da42d61a #1497 - Upgrade to Spring 5.3.5. 2021-03-16 10:21:43 +01:00
Oliver Drotbohm
ca1aebaaf6 #1494 - Improved HAL Link deserialization.
Configuring the Link.of(…) factory method as explicit creator method allows us to get rid of the wither chain previously required in HalLinkListDeserializer.
2021-03-16 09:45:16 +01:00
Oliver Drotbohm
8443bf788b #1492 - Upgrade to Jackson 2.12.2. 2021-03-16 08:59:52 +01:00
Oliver Drotbohm
2a37cbe148 #1489 - POM polishing. 2021-03-16 08:17:25 +01:00
Oliver Drotbohm
397dcc1a85 #1493 - Upgrade to JaCoCo 0.8.6. 2021-03-16 08:17:25 +01:00
Oliver Drotbohm
094ddfc5cf #1491 - Upgrade to Kotlin Coroutines 1.4.3. 2021-03-15 23:44:35 +01:00
Oliver Drotbohm
f0f69add5b #1490 - Upgrade to Reactor 2020.0.5. 2021-03-15 23:44:17 +01:00
Oliver Drotbohm
47486f42d7 #118 - Always default to fallback ConversionService in WebMvcLinkBuilder. 2021-03-11 14:44:46 +01:00
Oliver Drotbohm
8e78cf2275 #1484 - Fix performance regression in WebHandler.
Moved the affordance metadata caching into SpringAffordanceBuilder and separate the caching of the metadata lookup from the assembly of the affordance. The latter is based on the URI resulting from expanding the request mapping with the given value and thus is likely to produce a lot of different values so that they're rather unsuitable as cache key.

That means that we now return fresh Affordance instances for every request which probably causes a tiny hit on performance but still does not need additional metadata lookups. Also, it opens up the door to enrich the affordances with property value providers that would allow us to render affordance fields that refer to a instances property, e.g. to render edit forms.
2021-03-08 14:26:08 +01:00
Oliver Drotbohm
a665388758 #1483 - Reference docs for options support. 2021-03-08 13:50:01 +01:00
Oliver Drotbohm
94a50786f4 #1483 - Support for HAL-FORMS options element.
We now support defining the options element [0] for a HAL-FORMS property by registering a lookup of HalFormsOptions instances on HalFormsConfiguration.

[0] https://rwcbook.github.io/hal-forms/#options-element
2021-03-08 13:50:01 +01:00
Greg L. Turnquist
5592d29f68 #1482 - Properly collection version for CI jobs. 2021-02-26 15:41:25 -06:00
Greg L. Turnquist
254a2efd55 #1421 - Use JDK 15 for CI testing. 2021-02-24 10:03:37 -06:00
Oliver Drotbohm
a4aba5cbed #1477 - DelegatingEntityLinks implements EntityLinks. 2021-02-23 22:55:48 +01:00
Oliver Drotbohm
64254427d9 #1477 - Polishing. 2021-02-23 22:55:48 +01:00
Oliver Drotbohm
538a8a6874 #1477 - DelegatingEntityLinks now overrides linkForItemResource(Class<?>, Object). 2021-02-23 22:55:48 +01:00
Greg L. Turnquist
64c39692ff #1474 - Migrate to new Sonatype infrastructure. 2021-02-23 13:06:55 -06:00
Oliver Drotbohm
889f91cfed #1461 - Continue development on 1.3.0-SNAPSHOT. 2021-02-16 14:22:10 +01:00
Oliver Drotbohm
a40b2b5ed9 #1461 - Releasing Spring HATEOAS 1.3.0-M2. 2021-02-16 14:22:01 +01:00
Oliver Drotbohm
94fbb0b68b #1461 - Prepare 1.3 M2 release.
Updated changelog.
2021-02-16 14:18:49 +01:00
Oliver Drotbohm
1b42632534 #1452 - Upgrade to Spring 5.3.4. 2021-02-16 13:53:31 +01:00
Oliver Drotbohm
cd927e08a4 #1468 - Mapping discoverer now keeps trailing slashes around. 2021-02-16 12:52:24 +01:00
Oliver Drotbohm
3ea70227c4 #1462 - Upgrade to Reactor 2020.0.4. 2021-02-16 09:45:52 +01:00
Oliver Drotbohm
ef4c1c47eb #1461 - Switch to JakartaEE flavor of the validation API JAR. 2021-02-15 20:16:56 +01:00
Oliver Drotbohm
24a99d242b #1445, #1443, #1439, #1438, #1427 - Documentation for HAL-FORMS. 2021-02-15 19:30:54 +01:00
Oliver Drotbohm
2a4c5ca991 #1461 - Dependency upgrades prior to release.
AssertJ 3.18.0 -> 3.19.0
Docs resources 0.2.2 -> 0.2.5
Hibernate validator 6.1.7 -> 6.2.0
Jodatime 2.9.9 -> 2.10.10
JSONPath 2.4.0 -> 2.5.0
JUnit 5.7.0 -> 5.7.1
Kotlin 1.4.10 -> 1.4.30
Kotlin Coroutines 1.4.0 -> 1.4.2
Lombok 1.18.12 -> 1.18.18
Mockk 1.10.2 -> 1.10.6
Reactor 2020.0.0 -> 2020.0.3
2021-02-15 17:19:08 +01:00
Oliver Drotbohm
919b202856 #1458 - Parsing Link instances now supports unquoted attribute values.
Switched from using regular expressions to a simple manual parsing algorithm for the attributes attached to a link. Adapt a couple of broken tests that previously erroneously worked.
2021-02-15 15:41:22 +01:00
Oliver Drotbohm
6c910adf16 #1457 - Add RepresentationModel.mapLink(LinkRelation, Function<Link, Link>). 2021-02-11 19:00:26 +01:00
Oliver Drotbohm
0aae59a5e3 #1453 - Make sure we only extend the default MappingJackson2HttpMessageConverter.
This is to make sure the custom converters registered by Spring Data REST, which all extend MJ2HMC, do not get the general customizations added as they otherwise trump the explicit configuration that Spring Data REST sets up.
2021-02-11 18:53:12 +01:00
Oliver Drotbohm
bb3ed0add1 #1456 - Properly detect Validation API in 2.0 or newer.
We now check for the presence of @Email to detect validation API in 2.0 or better.
2021-02-11 18:50:39 +01:00
Oliver Drotbohm
0f2ac8ecac #1450 - Fix template variable cleanup for variables using regular expressions.
Switched to manual parsing of template variables as regular expressions can contain { and } characters which makes matching variables using these as delimiters impossible.

Related ticket: #1412.
2021-02-10 21:37:37 +01:00
Oliver Drotbohm
c561822a45 #1453 - Switch to new converter / codec registration APIs in Spring 5.3.4.
Changed the configuration of media type specific representation model rendering to rather use the existing MappingJackson2JsonConverter than registering custom HttpMessageConverters ourselves. The same applies to codecs in WebFlux.

Added HypermediaMappingInformationComparator to be able to sort HypermediaMappingInformation instances by their corresponding media type configuration on @EnableHypermediaSupport.
2021-02-10 19:19:56 +01:00
Oliver Drotbohm
2a0b113a3d #1451 - Upgrade to ArchUnit 0.16.0. 2021-02-10 16:37:37 +01:00
Oliver Drotbohm
a8a8836898 #1253 - Allow custom media type aliases for HAL.
HalConfiguration now exposes a withMediaType(…) that adds custom media types in front of the default of `application/hal+json`. This allows developers to use a project specific media type which is treated like it being HAL in the first place.
2021-02-10 16:23:50 +01:00
Oliver Drotbohm
f998ddf862 #1452 - Upgrade to Spring 5.3.4 snapshots. 2021-02-10 16:23:50 +01:00
Oliver Drotbohm
d0ff83c62e #118 - Use MVC ConversionService for parameter binding in link creation.
We now look up the ConversionService available in the ApplicationContext from Web(Mvc|Flux)LinkBuilder. Some API tweaks to WebHandler to allow the lookup from the current request. The general fallback is now the invocation of …toString() on the parameter value.

Fixes #118, #352, #144, #149.
2021-01-25 22:27:27 +01:00
Oliver Drotbohm
3da23a7d76 #1447 - Overhaul Jackson customizations for HAL FORMS.
Got rid of quite a few custom serializers in Jackson2HalFormsModule. We now rely on the HAL setup mostly and register a virtual bean property to render the _templates field. The Jackson component used for that is registered as Spring bean so that we can now use the HAL HandlerInstantiator with the Jackson2HalFormsModule.

Moved quite a few integration tests to the COntextualMapper API.
2021-01-22 21:58:43 +01:00
Oliver Drotbohm
b7877f2514 #1445 - Support for HAL FORMS type attribute on properties.
We now support rendering the type attribute on HAL FORMS properties derived from either an explicit @InputType annotation, derived from JSR-303 annotations (like @Email, @Range etc.), or the property's type as fallback.

Introduced HtmlInputType in a new 'html' package to capture the HTML input types needed for the implementation. That class is used as the default to derive the type based input types via a newly introduced InputTypeFactory registered via the Spring factories loader mechanism for user potentially plugging in a different strategy.
2021-01-22 12:24:14 +01:00
Greg L. Turnquist
e3b2fda613 #1444 - Fix settings for documentation publishing.
Documentation was not successfully release for 1.3.0-M1. This patches the gaps found that were used to get the docs out, so the CI server can do it properly next time.
2021-01-21 12:43:27 -06:00
Oliver Drotbohm
2be404ef04 #1443 - Expose affordance input media type in HAL FORMS contentType attribute.
Fixed the contentType in HalFormsTemplate to only contain a single media type.

Also adapted HalFormsAffordanceModelFactory to the new API introduced for #1441.
2021-01-21 17:39:51 +01:00
Oliver Drotbohm
8557e69fdb #1442 - Exposes consumed media types on affordances.
InputPayloadMetadata now captures and exposes supported media types. SpringAffordanceBuilder obtains them from the newly introduced API available on MappingDiscoverer.
2021-01-21 17:29:28 +01:00
Oliver Drotbohm
7bd414e79a #1441 - Introduce AffordanceModelFactory.getAffordanceModel(ConfiguredAffordance).
Introduce a new overload in AffordanceModelFactory so that implementations get a single object handed to work with for better extensibility in the future.

Introduced ConfigurableAffordance to be used instead of AffordanceBuilder in assignments and ConfiguredAffordance to separate creation and consumption of affordances during setup.
2021-01-21 15:38:31 +01:00
Oliver Drotbohm
60bf4e92ff #1405 - Use ConcurrentLruCache for affordances.
We now use a ConcurrentLruCache limited to 256 entries instead of a ConcurrentReferenceHashMap to cache Affordance instances to prevent the cache from growing unboundedly before GC kicks in.
2021-01-20 20:30:30 +01:00
Oliver Drotbohm
752b000e6c #1427 - Support for the target attribute of HAL FORMS templates.
We now explicitly set the target attribute of HAL FORMS templates if the target of the affordance does not equal the target of the self link.
2021-01-20 19:12:43 +01:00
Oliver Drotbohm
675f9e3895 #1439 - Support for HAL FORMS min, max, minLength and maxLength attributes.
Introduce support for the min, max, minLength and maxLength fields for HAL FORMS property descriptors. Extended PropertyMetadata to capture those based on JSR-303 annotations.

Pulled up InputPayloadMetadata.createProperties(…) into AffordanceModel directly. Deprecated InputPayloadMetadata.applyTo(…).
2021-01-20 17:17:51 +01:00
Oliver Drotbohm
a16c54f7b3 #1438 - Support for HAL FORMS' placeholder template properties.
See the spec [0] for details. Significant rework of how an AffordanceModel and HalFormsAffordanceModel in particular translates into creating a representation that matches the affordance (see InputPayloadMetadata.createProperties(…)).

[0] https://rwcbook.github.io/hal-forms/#_code_placeholder_code
2021-01-19 17:39:22 +01:00
Oliver Drotbohm
6ad9012047 #1428 - Avoid rendering curies if none is available.
If CurieProvider.getCurieInformation(Links) returns an empty list of curies, we now don't render curies at all.
2021-01-18 17:35:58 +01:00