mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-09-21 07:49:14 +00:00
Omit properties deprecated at error level from new appendix
Closes gh-47622
This commit is contained in:
+3
-2
@@ -97,7 +97,7 @@ class ConfigurationProperty {
|
||||
Deprecation.fromJsonProperties(deprecation));
|
||||
}
|
||||
|
||||
record Deprecation(String reason, String replacement, String since) {
|
||||
record Deprecation(String reason, String replacement, String since, String level) {
|
||||
|
||||
static Deprecation fromJsonProperties(Map<String, Object> property) {
|
||||
if (property == null) {
|
||||
@@ -106,7 +106,8 @@ class ConfigurationProperty {
|
||||
String reason = (String) property.get("reason");
|
||||
String replacement = (String) property.get("replacement");
|
||||
String since = (String) property.get("since");
|
||||
return new Deprecation(reason, replacement, since);
|
||||
String level = (String) property.get("level");
|
||||
return new Deprecation(reason, replacement, since, level);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
-1
@@ -30,6 +30,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.gradle.api.file.FileCollection;
|
||||
|
||||
import org.springframework.boot.build.context.properties.ConfigurationProperty.Deprecation;
|
||||
|
||||
/**
|
||||
* Configuration properties snippets.
|
||||
*
|
||||
@@ -118,7 +120,12 @@ class Snippets {
|
||||
}
|
||||
|
||||
private boolean shouldAdd(ConfigurationProperty property) {
|
||||
return (property == null || property.isDeprecated() == this.deprecated);
|
||||
return (property == null || (property.isDeprecated() == this.deprecated && !deprecatedAtErrorLevel(property)));
|
||||
}
|
||||
|
||||
private boolean deprecatedAtErrorLevel(ConfigurationProperty property) {
|
||||
Deprecation deprecation = property.getDeprecation();
|
||||
return deprecation != null && "error".equals(deprecation.level());
|
||||
}
|
||||
|
||||
private Asciidoc getAsciidoc(Snippet snippet, Table table) {
|
||||
|
||||
Reference in New Issue
Block a user