Switched to a regular expression based split of links to make sure URIs that contain commas do not interfere with the rather simplified splitting algorithm we used before.
Changed invocations of constructors of the super class in Jackson Serializers to use JavaType instead of Class<?> as the constructor has been removed in some of the base classes in Jackson 2.7.
Upgraded to Jackson 2.5.5 along the way.
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.
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.
673f82d introduced a glitch in a delegation within ControllerLinkBuilder.linkTo(Class<?> controller, Method method, Object... parameters) which is fixed by this commit.
Original pull request: #300.
Fixed imports in production code and test cases. Extended copyright range. Extracted request parameter handling into dedicated method. Added missing ticket reference.
Original pull request: #210.
Introduced Traverson.getDefaultMessageConverters(…) to be able to obtain the list of default HttpMessageConverters depending on the given media types. Added overloads for varargs as well as a List for consistency.
TypeReferences contains a set of predefined types that allows to shortcut the creation of ParameterizedTypeReference instances a bit, which is very useful for the usage on the client side (e.g., via RestTemplate).
new ParameterizedTypeReference<Resources<Resource<User>>>() {};
becomes
new TypeReferences.Resources<Resource<User>>() {};
The latter can even be abbreviated by using a static import for TypeReferences.
EmbeddedWrappers.wrap(Object, String) now allows empty collections. Also a new emptyCollectionOfType(Class<?>) was introduced to allow the RelProvider kick in and dynamically resolve the lazily.
Added more details to the JavaDoc of EmbeddedWrapper to make clear that we either expect a static rel returned or a type to resolve the rel from. Make HalEmbeddedBuilder detect invalid implementations and reject them although that should never occur if users use EmbeddedWrappers factory.