40
40
import java .util .concurrent .Executors ;
41
41
import java .util .stream .Collectors ;
42
42
43
+ import javax .annotation .PostConstruct ;
44
+
43
45
import com .fasterxml .jackson .annotation .JsonView ;
44
46
import com .fasterxml .jackson .databind .ObjectMapper ;
45
47
import com .fasterxml .jackson .dataformat .yaml .YAMLFactory ;
@@ -201,10 +203,8 @@ protected AbstractOpenApiResource(String groupName, ObjectFactory<OpenAPIBuilder
201
203
operationCustomizers .get ().removeIf (Objects ::isNull );
202
204
this .operationCustomizers = operationCustomizers ;
203
205
this .actuatorProvider = actuatorProvider ;
204
- if (springDocConfigProperties .isPreLoadingEnabled ()) {
205
- Executors .newSingleThreadExecutor ()
206
- .execute (this ::getOpenApi );
207
- }
206
+ if (springDocConfigProperties .isPreLoadingEnabled ())
207
+ Executors .newSingleThreadExecutor ().execute (this ::getOpenApi );
208
208
}
209
209
210
210
/**
@@ -231,13 +231,13 @@ public static void addHiddenRestControllers(Class<?>... classes) {
231
231
* @param classes the classes
232
232
*/
233
233
public static void addHiddenRestControllers (String ... classes ) {
234
- Set <Class <?>> hiddenClasses =new HashSet <>();
234
+ Set <Class <?>> hiddenClasses = new HashSet <>();
235
235
for (String aClass : classes ) {
236
236
try {
237
237
hiddenClasses .add (Class .forName (aClass ));
238
238
}
239
239
catch (ClassNotFoundException e ) {
240
- LOGGER .warn ("The following class doesn't exist and cannot be hidden: {}" , aClass );
240
+ LOGGER .warn ("The following class doesn't exist and cannot be hidden: {}" , aClass );
241
241
}
242
242
}
243
243
HIDDEN_REST_CONTROLLERS .addAll (hiddenClasses );
@@ -262,8 +262,8 @@ protected synchronized OpenAPI getOpenApi() {
262
262
Map <String , Object > findControllerAdvice = openAPIBuilder .getControllerAdviceMap ();
263
263
// calculate generic responses
264
264
openApi = openAPIBuilder .getCalculatedOpenAPI ();
265
- if (springDocConfigProperties .isOverrideWithGenericResponse () && !CollectionUtils .isEmpty (findControllerAdvice )){
266
- if (!CollectionUtils .isEmpty (mappingsMap ))
265
+ if (springDocConfigProperties .isOverrideWithGenericResponse () && !CollectionUtils .isEmpty (findControllerAdvice )) {
266
+ if (!CollectionUtils .isEmpty (mappingsMap ))
267
267
findControllerAdvice .putAll (mappingsMap );
268
268
responseBuilder .buildGenericResponse (openApi .getComponents (), findControllerAdvice );
269
269
}
@@ -969,7 +969,7 @@ protected void initOpenAPIBuilder() {
969
969
* @return the yaml mapper
970
970
*/
971
971
protected ObjectMapper getYamlMapper () {
972
- ObjectMapper objectMapper = Yaml .mapper ();
972
+ ObjectMapper objectMapper = Yaml .mapper ();
973
973
YAMLFactory factory = (YAMLFactory ) objectMapper .getFactory ();
974
974
factory .configure (Feature .USE_NATIVE_TYPE_ID , false );
975
975
return objectMapper ;
0 commit comments