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

Commit 97be1ca

Browse files
authored
open up some snippet methods for extension (#396)
1 parent af9c66e commit 97be1ca

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/misc/AuthorizationSnippet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ protected Map<String, Object> createModel(Operation operation) {
4747
return model;
4848
}
4949

50-
private String authorizationDescription(Operation operation) {
50+
protected String authorizationDescription(Operation operation) {
5151
String requestAuthorization = getAuthorization(operation);
5252
if (requestAuthorization != null) {
5353
return requestAuthorization;

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/misc/DescriptionSnippet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected Map<String, Object> createModel(Operation operation) {
6666
return model;
6767
}
6868

69-
private String resolveDeprecated(HandlerMethod handlerMethod, JavadocReader javadocReader, SnippetTranslationResolver translationResolver) {
69+
protected String resolveDeprecated(HandlerMethod handlerMethod, JavadocReader javadocReader, SnippetTranslationResolver translationResolver) {
7070
boolean isDeprecated = handlerMethod.getMethod().getAnnotation(Deprecated.class) != null;
7171
String deprecatedDoc = javadocReader.resolveMethodTag(handlerMethod.getBeanType(),
7272
handlerMethod.getMethod().getName(), "deprecated");
@@ -77,7 +77,7 @@ private String resolveDeprecated(HandlerMethod handlerMethod, JavadocReader java
7777
}
7878
}
7979

80-
private String resolveComment(HandlerMethod handlerMethod, JavadocReader javadocReader) {
80+
protected String resolveComment(HandlerMethod handlerMethod, JavadocReader javadocReader) {
8181
String methodComment = javadocReader.resolveMethodComment(handlerMethod.getBeanType(),
8282
handlerMethod.getMethod().getName());
8383
return addDot(capitalize(methodComment));

spring-auto-restdocs-core/src/main/java/capital/scalable/restdocs/section/SectionSnippet.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ public class SectionSnippet extends TemplatedSnippet {
5555

5656
public static final String SECTION = "auto-section";
5757

58-
private final RestDocumentationContextPlaceholderResolverFactory placeholderResolverFactory =
58+
protected final RestDocumentationContextPlaceholderResolverFactory placeholderResolverFactory =
5959
new RestDocumentationContextPlaceholderResolverFactory();
6060

61-
private final PropertyPlaceholderHelper propertyPlaceholderHelper =
61+
protected final PropertyPlaceholderHelper propertyPlaceholderHelper =
6262
new PropertyPlaceholderHelper("{", "}");
6363

64-
private final Collection<String> sectionNames;
65-
private final boolean skipEmpty;
64+
protected final Collection<String> sectionNames;
65+
protected final boolean skipEmpty;
6666

6767
public SectionSnippet(Collection<String> sectionNames, boolean skipEmpty) {
6868
super(SECTION, null);
@@ -89,7 +89,7 @@ protected Map<String, Object> createModel(Operation operation) {
8989
return model;
9090
}
9191

92-
private Collection<Section> createSections(Operation operation, SnippetTranslationResolver translationResolver) {
92+
protected Collection<Section> createSections(Operation operation, SnippetTranslationResolver translationResolver) {
9393
List<Section> sections = new ArrayList<>();
9494
for (String sectionName : sectionNames) {
9595
SectionSupport section = getSectionSnippet(operation, sectionName);
@@ -125,7 +125,7 @@ private Map<String, Object> defaultModel(Operation operation) {
125125
return model;
126126
}
127127

128-
private String resolveTitle(HandlerMethod handlerMethod, JavadocReader javadocReader,
128+
protected String resolveTitle(HandlerMethod handlerMethod, JavadocReader javadocReader,
129129
SnippetTranslationResolver translationResolver) {
130130
String title = javadocReader.resolveMethodTag(handlerMethod.getBeanType(),
131131
handlerMethod.getMethod().getName(), "title");

0 commit comments

Comments
 (0)