29
29
import java .util .stream .Collectors ;
30
30
import java .util .stream .Stream ;
31
31
32
- import static org .springdoc .core .Constants .SPRINGDOC_PACKAGES_TO_SCAN ;
33
- import static org .springdoc .core .Constants .SPRINGDOC_PATHS_TO_MATCH ;
32
+ import static org .springdoc .core .Constants .*;
34
33
35
34
public abstract class AbstractOpenApiResource {
36
35
@@ -46,6 +45,8 @@ public abstract class AbstractOpenApiResource {
46
45
private List <String > packagesToScan ;
47
46
@ Value (SPRINGDOC_PATHS_TO_MATCH )
48
47
private List <String > pathsToMatch ;
48
+ @ Value (SPRINGDOC_CACHE_DISABLED_VALUE )
49
+ private boolean cacheDisabled ;
49
50
50
51
protected AbstractOpenApiResource (OpenAPIBuilder openAPIBuilder , AbstractRequestBuilder requestBuilder ,
51
52
AbstractResponseBuilder responseBuilder , OperationBuilder operationParser ,
@@ -60,7 +61,7 @@ protected AbstractOpenApiResource(OpenAPIBuilder openAPIBuilder, AbstractRequest
60
61
61
62
protected AbstractOpenApiResource (OpenAPIBuilder openAPIBuilder , AbstractRequestBuilder requestBuilder ,
62
63
AbstractResponseBuilder responseBuilder , OperationBuilder operationParser ,
63
- Optional <List <OpenApiCustomiser >> openApiCustomisers , List <String > pathsToMatch , List <String > packagesToScan ) {
64
+ Optional <List <OpenApiCustomiser >> openApiCustomisers , List <String > pathsToMatch , List <String > packagesToScan , boolean cacheDisabled ) {
64
65
super ();
65
66
this .openAPIBuilder = openAPIBuilder ;
66
67
this .requestBuilder = requestBuilder ;
@@ -69,11 +70,12 @@ protected AbstractOpenApiResource(OpenAPIBuilder openAPIBuilder, AbstractRequest
69
70
this .openApiCustomisers = openApiCustomisers ;
70
71
this .pathsToMatch = pathsToMatch ;
71
72
this .packagesToScan = packagesToScan ;
73
+ this .cacheDisabled =cacheDisabled ;
72
74
}
73
75
74
76
protected synchronized OpenAPI getOpenApi () {
75
77
OpenAPI openApi ;
76
- if (!computeDone ) {
78
+ if (!computeDone || cacheDisabled ) {
77
79
Instant start = Instant .now ();
78
80
openAPIBuilder .build ();
79
81
Map <String , Object > restControllersMap = openAPIBuilder .getRestControllersMap ();
0 commit comments