4040import java .util .concurrent .Executors ;
4141import java .util .stream .Collectors ;
4242
43+ import javax .annotation .PostConstruct ;
44+
4345import com .fasterxml .jackson .annotation .JsonView ;
4446import com .fasterxml .jackson .databind .ObjectMapper ;
4547import com .fasterxml .jackson .dataformat .yaml .YAMLFactory ;
@@ -201,10 +203,8 @@ protected AbstractOpenApiResource(String groupName, ObjectFactory<OpenAPIBuilder
201203 operationCustomizers .get ().removeIf (Objects ::isNull );
202204 this .operationCustomizers = operationCustomizers ;
203205 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 );
208208 }
209209
210210 /**
@@ -231,13 +231,13 @@ public static void addHiddenRestControllers(Class<?>... classes) {
231231 * @param classes the classes
232232 */
233233 public static void addHiddenRestControllers (String ... classes ) {
234- Set <Class <?>> hiddenClasses =new HashSet <>();
234+ Set <Class <?>> hiddenClasses = new HashSet <>();
235235 for (String aClass : classes ) {
236236 try {
237237 hiddenClasses .add (Class .forName (aClass ));
238238 }
239239 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 );
241241 }
242242 }
243243 HIDDEN_REST_CONTROLLERS .addAll (hiddenClasses );
@@ -262,8 +262,8 @@ protected synchronized OpenAPI getOpenApi() {
262262 Map <String , Object > findControllerAdvice = openAPIBuilder .getControllerAdviceMap ();
263263 // calculate generic responses
264264 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 ))
267267 findControllerAdvice .putAll (mappingsMap );
268268 responseBuilder .buildGenericResponse (openApi .getComponents (), findControllerAdvice );
269269 }
@@ -969,7 +969,7 @@ protected void initOpenAPIBuilder() {
969969 * @return the yaml mapper
970970 */
971971 protected ObjectMapper getYamlMapper () {
972- ObjectMapper objectMapper = Yaml .mapper ();
972+ ObjectMapper objectMapper = Yaml .mapper ();
973973 YAMLFactory factory = (YAMLFactory ) objectMapper .getFactory ();
974974 factory .configure (Feature .USE_NATIVE_TYPE_ID , false );
975975 return objectMapper ;
0 commit comments