Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 46df17a

Browse files
authored
Change log level for missing descriptions to DEBUG (#335)
1 parent 82c58fb commit 46df17a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/constraints/ConstraintAndGroupDescriptionResolver.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -88,7 +88,7 @@ public String resolveGroupDescription(Class group, String constraintDescription)
8888
// Pretending that the group class is a constraint to use the same logic for getting
8989
// a description.
9090
Constraint groupConstraint = new Constraint(group.getCanonicalName(),
91-
singletonMap(VALUE, (Object) constraintDescription));
91+
singletonMap(VALUE, constraintDescription));
9292
String result = resolvePlainDescription(groupConstraint);
9393
return isBlank(result) ? fallbackGroupDescription(group, constraintDescription) : result;
9494
}
@@ -101,8 +101,8 @@ private String resolvePlainDescription(Constraint constraint) {
101101
try {
102102
return delegate.resolveDescription(constraint);
103103
} catch (MissingResourceException e) {
104-
log.warn("No description found for constraint {}: {}", constraint.getName(),
105-
e.getMessage());
104+
log.debug("No description found for constraint {}: {}. " +
105+
"Fallback to group description.", constraint.getName(), e.getMessage());
106106
return "";
107107
}
108108
}

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/constraints/ConstraintReaderImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/javadoc/JavadocReaderImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -146,7 +146,7 @@ private ClassJavadoc readFiles(Class<?> clazz, String relativePath) {
146146
return readJson(url);
147147
}
148148

149-
log.warn("No Javadoc found for class {}", clazz.getCanonicalName());
149+
log.debug("No Javadoc found for class {} in any of the found JSON files", clazz.getCanonicalName());
150150
return new ClassJavadoc();
151151
}
152152

0 commit comments

Comments
 (0)