#455 - More removals of deprecations in ResourcesMixin.
This commit is contained in:
@@ -576,6 +576,7 @@ public class Jackson2HalModule extends SimpleModule {
|
||||
|
||||
// links is an object, so we parse till we find its end.
|
||||
while (!JsonToken.END_OBJECT.equals(jp.nextToken())) {
|
||||
|
||||
if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) {
|
||||
throw new JsonParseException("Expected relation name", jp.getCurrentLocation());
|
||||
}
|
||||
@@ -651,6 +652,7 @@ public class Jackson2HalModule extends SimpleModule {
|
||||
|
||||
// links is an object, so we parse till we find its end.
|
||||
while (!JsonToken.END_OBJECT.equals(jp.nextToken())) {
|
||||
|
||||
if (!JsonToken.FIELD_NAME.equals(jp.getCurrentToken())) {
|
||||
throw new JsonParseException("Expected relation name", jp.getCurrentLocation());
|
||||
}
|
||||
@@ -658,7 +660,6 @@ public class Jackson2HalModule extends SimpleModule {
|
||||
if (JsonToken.START_ARRAY.equals(jp.nextToken())) {
|
||||
while (!JsonToken.END_ARRAY.equals(jp.nextToken())) {
|
||||
object = deser.deserialize(jp, ctxt);
|
||||
;
|
||||
result.add(object);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2013 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,6 +21,8 @@ import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import org.springframework.hateoas.Resources;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
@@ -32,8 +34,8 @@ public abstract class ResourcesMixin<T> extends Resources<T> {
|
||||
@Override
|
||||
@XmlElement(name = "embedded")
|
||||
@JsonProperty("_embedded")
|
||||
@JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY, using = Jackson2HalModule.HalResourcesSerializer.class)
|
||||
@JsonInclude(Include.NON_EMPTY)
|
||||
@JsonSerialize(using = Jackson2HalModule.HalResourcesSerializer.class)
|
||||
@JsonDeserialize(using = Jackson2HalModule.HalResourcesDeserializer.class)
|
||||
public abstract Collection<T> getContent();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user