19
19
package org .springdoc .api ;
20
20
21
21
import java .io .UnsupportedEncodingException ;
22
- import java .lang .annotation .Annotation ;
23
- import java .lang .reflect .AnnotatedElement ;
24
22
import java .lang .reflect .Method ;
25
23
import java .net .URLDecoder ;
26
24
import java .nio .charset .StandardCharsets ;
35
33
import java .util .Optional ;
36
34
import java .util .Set ;
37
35
import java .util .stream .Collectors ;
38
- import java .util .stream .Stream ;
39
36
40
37
import com .fasterxml .jackson .annotation .JsonView ;
41
38
import io .swagger .v3 .core .filter .SpecFilter ;
60
57
import org .springdoc .core .customizers .OpenApiCustomiser ;
61
58
import org .springdoc .core .customizers .OperationCustomizer ;
62
59
63
- import org .springframework .core .MethodParameter ;
64
60
import org .springframework .core .annotation .AnnotatedElementUtils ;
65
61
import org .springframework .core .annotation .AnnotationUtils ;
66
62
import org .springframework .util .AntPathMatcher ;
70
66
import org .springframework .web .bind .annotation .RequestMethod ;
71
67
import org .springframework .web .method .HandlerMethod ;
72
68
69
+ import static org .springdoc .core .converters .SchemaPropertyDeprecatingConverter .isDeprecated ;
70
+
73
71
public abstract class AbstractOpenApiResource extends SpecFilter {
74
72
75
73
private static final Logger LOGGER = LoggerFactory .getLogger (AbstractOpenApiResource .class );
@@ -78,12 +76,6 @@ public abstract class AbstractOpenApiResource extends SpecFilter {
78
76
79
77
private static final List <Class <?>> HIDDEN_REST_CONTROLLERS = new ArrayList <>();
80
78
81
- public static final List <Class <? extends Annotation >> DEPRECATED_ANNOTATIONS = new ArrayList <>();
82
-
83
- static {
84
- DEPRECATED_ANNOTATIONS .add (Deprecated .class );
85
- }
86
-
87
79
protected final OpenAPIBuilder openAPIBuilder ;
88
80
89
81
protected final SpringDocConfigProperties springDocConfigProperties ;
@@ -129,10 +121,6 @@ public static void addHiddenRestControllers(Class<?>... classes) {
129
121
HIDDEN_REST_CONTROLLERS .addAll (Arrays .asList (classes ));
130
122
}
131
123
132
- public static void addDeprecatedType (Class <? extends Annotation > cls ) {
133
- DEPRECATED_ANNOTATIONS .add (cls );
134
- }
135
-
136
124
protected synchronized OpenAPI getOpenApi () {
137
125
OpenAPI openApi ;
138
126
if (openAPIBuilder .getCachedOpenAPI () == null || springDocConfigProperties .isCacheDisabled ()) {
@@ -415,7 +403,4 @@ protected Operation customiseOperation(Operation operation, HandlerMethod handle
415
403
return operation ;
416
404
}
417
405
418
- private boolean isDeprecated (AnnotatedElement annotatedElement ) {
419
- return DEPRECATED_ANNOTATIONS .stream ().anyMatch (annoClass -> AnnotatedElementUtils .findMergedAnnotation (annotatedElement , annoClass ) != null );
420
- }
421
406
}
0 commit comments