Omit properties deprecated at error level from new appendix

Closes gh-47622
This commit is contained in:
Andy Wilkinson
2025-10-22 10:46:35 +01:00
parent 92e61fd328
commit c249d952ab
2 changed files with 11 additions and 3 deletions
@@ -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);
}
}
@@ -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) {