#699 - Render additional RFC5988 attributions in HAL.

This commit is contained in:
Jeffrey Walraven
2018-02-16 20:51:16 -05:00
committed by Greg Turnquist
parent 1e32bb5d2d
commit ba1dae383c
2 changed files with 42 additions and 2 deletions

View File

@@ -82,6 +82,7 @@ import com.fasterxml.jackson.databind.type.TypeFactory;
*
* @author Alexander Baetz
* @author Oliver Gierke
* @author Jeffrey Walraven
*/
public class Jackson2HalModule extends SimpleModule {
@@ -573,11 +574,19 @@ public class Jackson2HalModule extends SimpleModule {
if (JsonToken.START_ARRAY.equals(jp.nextToken())) {
while (!JsonToken.END_ARRAY.equals(jp.nextToken())) {
link = jp.readValueAs(Link.class);
result.add(new Link(link.getHref(), relation));
result.add(new Link(link.getHref(), relation)
.withHreflang(link.getHreflang())
.withTitle(link.getTitle())
.withType(link.getType())
.withDeprecation(link.getDeprecation()));
}
} else {
link = jp.readValueAs(Link.class);
result.add(new Link(link.getHref(), relation));
result.add(new Link(link.getHref(), relation)
.withHreflang(link.getHreflang())
.withTitle(link.getTitle())
.withType(link.getType())
.withDeprecation(link.getDeprecation()));
}
}