diff --git a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java index 7682f4e75..47889effe 100644 --- a/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java +++ b/spring-data-rest-core/src/main/java/org/springframework/data/rest/core/config/RepositoryRestConfiguration.java @@ -21,13 +21,10 @@ import java.util.Collections; import java.util.List; import org.springframework.data.repository.support.Repositories; -import org.springframework.data.rest.core.annotation.RepositoryRestResource; -import org.springframework.data.rest.core.annotation.RestResource; import org.springframework.data.rest.core.mapping.ExposureConfiguration; import org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy; import org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy.RepositoryDetectionStrategies; import org.springframework.data.rest.core.support.EntityLookup; -import org.springframework.hateoas.LinkRelation; import org.springframework.hateoas.MediaTypes; import org.springframework.hateoas.server.LinkRelationProvider; import org.springframework.hateoas.server.core.AnnotationLinkRelationProvider; @@ -57,7 +54,7 @@ public class RepositoryRestConfiguration { private String pageParamName = "page"; private String limitParamName = "size"; private String sortParamName = "sort"; - private MediaType defaultMediaType = MediaTypes.HAL_JSON; + private MediaType defaultMediaType = MediaTypes.VND_HAL_JSON; private boolean useHalAsDefaultJsonMediaType = true; private Boolean returnBodyOnCreate = null; private Boolean returnBodyOnUpdate = null; diff --git a/spring-data-rest-hal-explorer/src/test/java/org/springframework/data/rest/webmvc/halexplorer/HalExplorerIntegrationTests.java b/spring-data-rest-hal-explorer/src/test/java/org/springframework/data/rest/webmvc/halexplorer/HalExplorerIntegrationTests.java index 7981ac94b..12bde80d6 100755 --- a/spring-data-rest-hal-explorer/src/test/java/org/springframework/data/rest/webmvc/halexplorer/HalExplorerIntegrationTests.java +++ b/spring-data-rest-hal-explorer/src/test/java/org/springframework/data/rest/webmvc/halexplorer/HalExplorerIntegrationTests.java @@ -80,7 +80,7 @@ class HalExplorerIntegrationTests { mvc.perform(get(BASE_PATH).accept(MediaType.ALL)).// andExpect(status().isOk()).// - andExpect(header().string(HttpHeaders.CONTENT_TYPE, startsWith(MediaTypes.HAL_JSON.toString()))); + andExpect(header().string(HttpHeaders.CONTENT_TYPE, startsWith(MediaTypes.VND_HAL_JSON.toString()))); } @Test // DATAREST-293 diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java index 7496522dc..42f12aab9 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java @@ -574,8 +574,8 @@ public class RepositoryRestMvcConfiguration extends HateoasAwareSpringDataWebCon RepositoryRestConfiguration repositoryRestConfiguration) { ArrayList mediaTypes = new ArrayList<>(); - mediaTypes.add(MediaTypes.HAL_JSON); mediaTypes.add(MediaTypes.VND_HAL_JSON); + mediaTypes.add(MediaTypes.HAL_JSON); // Enable returning HAL if application/json is asked if it's configured to be the default type if (repositoryRestConfiguration.useHalAsDefaultJsonMediaType()) {