#1132 - HAL link relation rendering now applies Jackson's PropertyNamingStrategy.
The rendering of HAL's link relations now applies Jackson's PropertyNamingStrategy if one is configured except it's a IANA link relation. This behavior can be opt out from by setting HalConfiguration.withApplyPropertyNamingStrategy(false). LinkRelation now has a ….map(…) method allowing the post-processing of it given a Function<String, String>. By default, that's applied to all relations that are not IANA ones. HalLinkRelation applies this transformation to only the local part of the relation. Tweaked IanaLinkRelations.isIanaLinkRelation(…) to do a simple ….contains(…) check first before we stream over all values to apply a case insensitive check.
This commit is contained in:
@@ -786,8 +786,8 @@ public class IanaLinkRelations {
|
||||
|
||||
Assert.notNull(relation, "Link relation must not be null!");
|
||||
|
||||
return LINK_RELATIONS.stream() //
|
||||
.anyMatch(it -> it.value().equalsIgnoreCase(relation.value()));
|
||||
return LINK_RELATIONS.contains(relation) //
|
||||
|| LINK_RELATIONS.stream().anyMatch(it -> it.isSameAs(relation));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user