Configuring the Link.of(…) factory method as explicit creator method allows us to get rid of the wither chain previously required in HalLinkListDeserializer.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
Fixed the contentType in HalFormsTemplate to only contain a single media type.
Also adapted HalFormsAffordanceModelFactory to the new API introduced for #1441.
InputPayloadMetadata now captures and exposes supported media types. SpringAffordanceBuilder obtains them from the newly introduced API available on MappingDiscoverer.
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.
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.
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(…).
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