ControllerLinkBuilderFactory now forwards the source UriComponents to the ControllerLinkBuilder instead of turning it into a URI and a UriComponentsBuilder in turn.
Original pull request: #422.
DefaultCurieProvider now automatically adds the application URI (servlet mapping) in case the UriTemplate configured does not contain an absolute URI in the first place.
Re-introduced the simple isEmpty(…) methods in custom Jackson serializers as the more complex ones were introduced in Jackson 2.5 only. Removed the @Override annotations so that we could even compile against 2.4 if needed.
We now avoid calling URI.toString() to early to prevent the need to re-parse it and thus accidentally cause a double-encoding.
Original pull request: #382.
This commit updates Spring HATEOAS' optional dependency on the JAX-RS API to use the latest version (which uses a different artifact ID). This change will make things a little easier for the Spring IO Platform which currently provides dependency management for Jersey 2.x (which uses JAX-RS 2.0), by allowing it to stop providing dependency management for the JAX-RS 1.0 API.
HalLinkListSerializer now tries to obtain a link title by looking up key _links.$rel.title for both the namespaced (curied) and local link relation if the former doesn't resolve into a message.
The curie rendering has been improved in the following ways:
- Resources now get their embeds inspected for namespaced keys and curies are added if at least one is found. This makes sure curies are also rendered if no namespaced link is registered.
- Nested resources skip curies entirely, assuming they have been added to the root correctly.
Had to change the order of _embedded and _links to make sure the embedded elements are processed first to tweak the links to indicate the need for curies.
DefaultCurieProvider now also takes a Map<String, UriTemplate> to expose multiple curies. The default curie to be used to expand unprefixed, non-IANA link relations has to be defined explicitly in case more than one curie is if given. If there's only one, that becomes the default, too.
Added missing override for isEmpty(…) that gets used by Jackson 2.6+ to prevent { templated : false } get rendered in HAL link representations.
Polished Javadoc on the way.
Switched from overrides of the deprecated (and removed in 2.6) isEmpty(T) to isEmpty(SerializerProvider, T). Switched from deprecated @JsonSerialize(include = …) to the dedicated @JsonInclude annotation.
We now locally resolve the generic type using Jackson's JavaType in canRead(Type, Class, MediaType) to avoid having to call the non-generic method as this caused us having to tweak it's implementation to avoid the super.canRead(Class, MediaType) check as this in turn forwards to the generic method (which then would've caused a stack overflow.
Turned hop into a real value object by making it immutable. Added unit tests for Hop. use verbose concept names instead of abbreviations (e.g. parameters instead of params). Additional assertions and the documentation of such in JavaDoc. @since tag in new Hop class.
Original pull request: #350
Introduced a dedicated value object to abstract a Hop within a relation traversal. The Hop consists of a relation name and optional local template parameters that are applied to this particular hop when traversing it.
Changed the implementation of Traverson to work with Hops instead of plain rels and merges the global template parameters with the hop-local ones before expanding the templates found.
Original pull request: #350.
Extracted exception message into a constant. Added author where necessary and extended copyright headers. Fixed import order. Moved unit test into ControllerLinkBuilderUnitTest. Tweaked it to use JUnit rule.
Original pull request: #344.
We now explicitly check whether we could look up request attributes and throw an exception with a message indicating the cause of the failure.
Original pull request: #344.
We now explicitly disable the "fail on unknown properties" deserialization feature for the ObjectMapper instance used with our default HAL setup to be able to use it with a RestTemplate out of the box.
ControllerLinkBuilderFactory now checks the default value of an @RequestParam annotated handler method parameter before triggering strict validation.
Original pull request: #332.
Relation names can be fully qualified URIs. HalLinkDiscoverer now quotes the relation name handed into the constructor so that the expression parsing works as expected.
We now reflectively invoke the JSONPath.compile(…) method as the method signature has changed but we need to stay compatible with 0.9 to allow the Spring Data Evans release train to upgrade to 0.17 without a major third-party dependency upgrade.
Copied the reflective method lookup from Spring's JsonPathExpectationsHelper.
Related ticket: #297, #305.
Renamed the Resource, Resources and PagedResources types in TypeReferences to *Type so that new TypeReferences.Resources<User>() {} now becomes new ResourcesType<User>() {}.
Prior to this change a static import of TypeReferences would've cause the actual Resource types to be fully qualified.