#987 - Drop UTF8 HAL media type.
This commit is contained in:
@@ -37,16 +37,6 @@ public class MediaTypes {
|
||||
*/
|
||||
public static final MediaType HAL_JSON = MediaType.valueOf(HAL_JSON_VALUE);
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MediaTypes#HAL_JSON_UTF8}.
|
||||
*/
|
||||
public static final String HAL_JSON_UTF8_VALUE = HAL_JSON_VALUE + ";charset=UTF-8";
|
||||
|
||||
/**
|
||||
* Public constant media type for {@code application/hal+json;charset=UTF-8}.
|
||||
*/
|
||||
public static final MediaType HAL_JSON_UTF8 = MediaType.valueOf(HAL_JSON_UTF8_VALUE);
|
||||
|
||||
/**
|
||||
* A String equivalent of {@link MediaTypes#ALPS_JSON}.
|
||||
*/
|
||||
|
||||
@@ -73,7 +73,7 @@ public @interface EnableHypermediaSupport {
|
||||
* @see http://stateless.co/hal_specification.html
|
||||
* @see https://tools.ietf.org/html/draft-kelly-json-hal-05
|
||||
*/
|
||||
HAL(MediaTypes.HAL_JSON, MediaTypes.HAL_JSON_UTF8),
|
||||
HAL(MediaTypes.HAL_JSON),
|
||||
|
||||
/**
|
||||
* HAL-FORMS - Independent, backward-compatible extension of the HAL designed to add runtime FORM support
|
||||
|
||||
@@ -36,7 +36,7 @@ public class HalLinkDiscoverer extends JsonPathLinkDiscoverer {
|
||||
* Constructor for {@link MediaTypes#HAL_JSON}.
|
||||
*/
|
||||
public HalLinkDiscoverer() {
|
||||
this(MediaTypes.HAL_JSON, MediaTypes.HAL_JSON_UTF8);
|
||||
this(MediaTypes.HAL_JSON);
|
||||
}
|
||||
|
||||
protected HalLinkDiscoverer(MediaType... mediaTypes) {
|
||||
|
||||
@@ -17,7 +17,6 @@ package org.springframework.hateoas.mediatype.hal;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
@@ -41,7 +40,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
*/
|
||||
class HalTraversonDefaults implements TraversonDefaults {
|
||||
|
||||
private static final List<MediaType> HAL_FLAVORS = Arrays.asList(MediaTypes.HAL_JSON, MediaTypes.HAL_JSON_UTF8);
|
||||
private static final List<MediaType> HAL_FLAVORS = Collections.singletonList(MediaTypes.HAL_JSON);
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -54,7 +53,7 @@ class HalTraversonDefaults implements TraversonDefaults {
|
||||
converters.add(new StringHttpMessageConverter(StandardCharsets.UTF_8));
|
||||
|
||||
List<MediaType> halFlavors = mediaTypes.stream() //
|
||||
.filter(it -> HAL_FLAVORS.contains(it)) //
|
||||
.filter(HAL_FLAVORS::contains) //
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (!halFlavors.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user