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
It doesn't make sense to wrap an object to be rendered as value into an EntityModel as the latter will end up as JSON Object and thus, the representation of the target object *needs* to consist of key-value pairs.
Previously we just produced invalid JSON which ultimately failed as well.
RFC-6570 specifies percent-encoding as a valid way to encode characters. By expanding the regex for UriTemplate to include '%', it's possible to support all variants.
See: https://tools.ietf.org/html/rfc6570#section-2.3
Original issue: #246
The code handling CollectionModel types now also checks for the element type being a RepresentationModel instance and checking whether the detected collection element matches the declared type.
We previously didn't render the curie information if the process of curying didn't actually change the link relation if it was already given in a curied form. We now check preprocessed link relation for a curie and include the curie information if we find a curie.
CollectionModelProcessorWrapper erroneously returned a raw type in case a CollectionModel type assignment check failed which rendered the element type verification to always match as it's effectively compared against Object.
We're now returning null to rather proceed with the next candidate type.
Let HalForms register a custom ObjectMapper customizer to allow separate customizations. If HAL and HAL Forms are supposed to be customized the same way, the same customizer can be registered on both instances. Tweak the application of the customizer to happen inside the configuration classes, not on the outside.
Prepare HalFormsConfiguration to become a fully immutable type in 1.3. Javadoc and assertion polish.
Original pull request: #1383.
We now use a custom serializer for EntityModel.getContent() as we need that to still return the Map content for programmatic clients. The serializer skips maps entirely and programmatically unwraps all other content.
A simple Converter (@JsonSerialize(convert = …)) to filter Maps unfortunately didn't do the trick as that causes a a delegating serializer to be registered for the property and @JsonUnwrapped stops working as it's designed to work with bean serializers only.
Adapted test cases accordingly.
Original pull request: #1353.