#665 - Fix ALPS format.
According to the ALPS spec, it's "descriptor" not "descriptors", despite it depicting an array of potentially multiple values. Also fixed the ordering to match as closely as possible all the samples shown in the spec. Original pull request: #666.
This commit is contained in:
committed by
Oliver Gierke
parent
b71e1286cf
commit
22bd76db49
@@ -30,18 +30,19 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
* An ALPS document.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io
|
||||
* @see http://alps.io/spec/#prop-alps
|
||||
*/
|
||||
@Value
|
||||
@Builder(builderMethodName = "alps")
|
||||
@JsonPropertyOrder({"version", "doc", "descriptors"})
|
||||
@JsonPropertyOrder({"version", "doc", "descriptor"})
|
||||
public class Alps {
|
||||
|
||||
private final String version = "1.0";
|
||||
private final Doc doc;
|
||||
private final List<Descriptor> descriptors;
|
||||
private final List<Descriptor> descriptor;
|
||||
|
||||
/**
|
||||
* Returns a new {@link DescriptorBuilder}.
|
||||
|
||||
@@ -20,15 +20,19 @@ import lombok.Value;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* A value object for an ALPS descriptor.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io/spec/#prop-descriptor
|
||||
*/
|
||||
@Value
|
||||
@Builder
|
||||
@JsonPropertyOrder({"id", "href", "name", "type", "doc", "descriptor", "ext"})
|
||||
public class Descriptor {
|
||||
|
||||
private final String id, href, name;
|
||||
@@ -36,5 +40,5 @@ public class Descriptor {
|
||||
private final Type type;
|
||||
private final Ext ext;
|
||||
private final String rt;
|
||||
private final List<Descriptor> descriptors;
|
||||
private final List<Descriptor> descriptor;
|
||||
}
|
||||
|
||||
@@ -21,16 +21,20 @@ import lombok.Value;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* A value object for an ALPS doc element.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io/spec/#prop-doc
|
||||
*/
|
||||
@Value
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@JsonPropertyOrder({"format", "href", "value"})
|
||||
public class Doc {
|
||||
|
||||
private final String href, value;
|
||||
|
||||
@@ -18,15 +18,19 @@ package org.springframework.hateoas.alps;
|
||||
import lombok.Builder;
|
||||
import lombok.Value;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
|
||||
/**
|
||||
* A value object for an ALPS ext element.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io/spec/#prop-ext
|
||||
*/
|
||||
@Value
|
||||
@Builder
|
||||
@JsonPropertyOrder({"id", "href", "value"})
|
||||
public class Ext {
|
||||
|
||||
private final String id;
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Locale;
|
||||
* Enum for all ALPS doc formats.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io/spec/#prop-format
|
||||
*/
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Locale;
|
||||
* An enum for ALPS descriptor types
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
* @author Greg Turnquist
|
||||
* @since 0.15
|
||||
* @see http://alps.io/spec/#prop-type
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user