From b9f4fd0b6547e7a06a1db81d5272ad869f9bae5b Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Mon, 8 Jan 2018 17:44:32 +0100 Subject: [PATCH] Fix exclude filter to not exclude MediaType This commit removes MediaType from the list of exclude types as it looks like an error: MediaType has a constructor taking a `String` and binding works fine with it. This has the effect of properly generating the metadata for the only key that Spring Boot exposes with a MediaType type: spring.data.rest.default-media-type. Closes gh-11568 --- .../src/main/asciidoc/appendix-application-properties.adoc | 1 + .../boot/configurationprocessor/TypeExcludeFilter.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index f318704ed6..b213a3969c 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -608,6 +608,7 @@ content into your application; rather pick only the properties that you need. # DATA REST ({sc-spring-boot-autoconfigure}/data/rest/RepositoryRestProperties.{sc-ext}[RepositoryRestProperties]) spring.data.rest.base-path= # Base path to be used by Spring Data REST to expose repository resources. + spring.data.rest.default-media-type= # Content type to use as a default when none is specified. spring.data.rest.default-page-size= # Default size of pages. spring.data.rest.detection-strategy=default # Strategy to use to determine which repositories get exposed. spring.data.rest.enable-enum-translation= # Enable enum value translation via the Spring Data REST default resource bundle. diff --git a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeExcludeFilter.java b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeExcludeFilter.java index c8ba4a8d5b..2e17df661c 100644 --- a/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeExcludeFilter.java +++ b/spring-boot-tools/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeExcludeFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2018 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. @@ -46,7 +46,6 @@ class TypeExcludeFilter { add("org.apache.tomcat.jdbc.pool.Validator"); add("org.flywaydb.core.api.callback.FlywayCallback"); add("org.flywaydb.core.api.resolver.MigrationResolver"); - add("org.springframework.http.MediaType"); } private void add(String className) {