Deserializing a Link with a templated URI will cause Jackson to break due to there being no "templated" property. This adds a private, no-op `setTemplated` method to allow deserialization to occur yet not alter the Link..
By removing all Jaxb annotations, requesting data from a hypermedia-enabled endpoint inside a browser (which defaults to accept:application/xhtml+xml,*/*), Spring HATEOAS will yield HAL.
Spring 5.1 is centralizing all Forward header handling. This moves critical bits into one location, making it easy to completely remove once we rebaseline against this version.
Also adds a test profile to ensure Spring 5.1 doesn't break anything.
Original pull request: #717.
We now avoid to register ObjectMapper instances as Spring beans and rather use one already existing in the ApplicationContext and copying the setup before registering the individual HttpMessageConverters for the individual media types.
Replaced a lot of the programmatic component setup via BeanDefinitions with their corresponding JavaConfig alternatives.
Removed obsolete media type specific HttpMessageConverters and configuration classes registering them.
Introduce support for media type application/vnd.collection+json. Collection+JSON doesn't allow metadata at the top, so paging data can't be covered, however, everything else fits.
Also moved a little bit more into Affordance and SpringMvcAffordance to avoid using Spring MVC annotations directly in a given mediatype's AffordanceModel.
Refactored bits of HAL-FORMS to reuse the new PropertyUtils, ensuring Jackson ignore annotations are taken into consideration. Also added MockMVC tests to show HAL-FORMS and Collection+JSON working together, against the same controller.
According to the ALPS spec, it's "descriptor" not "descriptors", despite it depicting an array of potentially multiple values. Also fixed the ordering to match as closely as possible all the samples shown in the spec.
Original pull request: #666.
Side effect of upgrading Jackson appears to be arbitrary change in order of property serialization. This commit forces the order to match the spec and fixes the related test cases.
Moved AffordanceModelFactory into core package as it's SPI. Switched to Spring Factories lookup of implementation classes so that we avoid a package dependency between the MVC package and the media type specific packages. Removed reference to MediaType from AffordanceModelFactory to AffordanceModel so that a factory can even provide models for different MediaTypes (i.e. different flavors of the same one, e.g. HAL Forms for JSON and XML). Also removed addAffordanceModel(…) from Affordance to not force the implementations into mutability. Made most of the affordance building API types package protected. HalFormsAffordanceModel now uses MethodParameters abstraction to simplify model parsing code.
Tweaked HAL forms model to work with factory methods for required properties and wither methods to add optional properties. Tweaked and inlined mixin types in Jackson module for HAL forms.
Slight API polishing on Link to make sure Affordance collecting methods are not named with….
Tweaked Lombok setup to use all caps for logger constants. Removed deprecation warnings in Jackson2HalModule.
* Introduces new Affordances API to build links related to each other to serve other mediatypes
* Introduces HAL-FORMS, which uses affordances to automatically generate HTML form data based on Spring MVC annotations.
Original pull-request: #340, #447, #581
Related issues: #503, #334, #71
Since `ResourceSupport` has direct access to the list of links, no need to build up an intermedia `List` and then filter on it. Simply filter on the internal list of links. Also did some minor polishing.
Moved RenderSingleLinks enum into HalConfiguration. Simplified HalConfiguration setup by moving the default into the class. The lookup of a user-provided HalConfiguration is now handled on the bean name level to avoid premature initialization of a potentially defined bean. Formatting.
Original pull request: #295
Related issues: #291
We now expose HalConfiguration to be defined as Spring bean in user configuration to control certain aspects of the HAL rendering. Initially we allow to control whether links shall always be rendered as collection. If no user-provided bean is available, we register a default instance.
Original pull request: #295
Related issues: #291
Added application/hal+json;charset=UTF-8 to the media types enum. Traverson now configures all HAL flavors to be supported by the registered HAL-specific HttpMessageConverter.
Removed nullability of media type in JsonPathLinkDiscoverer. This requires subclasses that want to support all media types to explicitly configure MediaType.ALL.
Heavily inspired by the PR submitted by @drummond but very significantly rewritten.
Adds many additional attributes defined in RFC5988 and verifies they work properly in the neutral representation of Link while also being rendered properly in the HAL module.
Related tickets: #100, #417, #235
Previous pull requests: #240, #238, #223, #79
Spring 5 has adopted a "no nulls" policy that causes certain methods to throw exceptions instead of returning a null. This updates Spring HATEOAS to handle it suitably.
Original pull request: #595.