6666import org .apache .commons .lang3 .StringUtils ;
6767import org .slf4j .Logger ;
6868import org .slf4j .LoggerFactory ;
69- import org .springdoc .core .AbstractRequestBuilder ;
69+ import org .springdoc .core .AbstractRequestService ;
7070import org .springdoc .core .ActuatorProvider ;
71- import org .springdoc .core .GenericParameterBuilder ;
72- import org .springdoc .core .GenericResponseBuilder ;
71+ import org .springdoc .core .GenericParameterService ;
72+ import org .springdoc .core .GenericResponseService ;
7373import org .springdoc .core .MethodAttributes ;
74- import org .springdoc .core .OpenAPIBuilder ;
75- import org .springdoc .core .OperationBuilder ;
74+ import org .springdoc .core .OpenAPIService ;
75+ import org .springdoc .core .OperationService ;
7676import org .springdoc .core .SpringDocConfigProperties ;
7777import org .springdoc .core .SpringDocConfigProperties .GroupConfig ;
7878import org .springdoc .core .annotations .RouterOperations ;
@@ -119,12 +119,12 @@ public abstract class AbstractOpenApiResource extends SpecFilter {
119119 /**
120120 * The Open api builder.
121121 */
122- protected OpenAPIBuilder openAPIBuilder ;
122+ protected OpenAPIService openAPIService ;
123123
124124 /**
125125 * The open api builder object factory.
126126 */
127- private final ObjectFactory <OpenAPIBuilder > openAPIBuilderObjectFactory ;
127+ private final ObjectFactory <OpenAPIService > openAPIBuilderObjectFactory ;
128128
129129 /**
130130 * The Spring doc config properties.
@@ -139,17 +139,17 @@ public abstract class AbstractOpenApiResource extends SpecFilter {
139139 /**
140140 * The Request builder.
141141 */
142- private final AbstractRequestBuilder requestBuilder ;
142+ private final AbstractRequestService requestBuilder ;
143143
144144 /**
145145 * The Response builder.
146146 */
147- private final GenericResponseBuilder responseBuilder ;
147+ private final GenericResponseService responseBuilder ;
148148
149149 /**
150150 * The Operation parser.
151151 */
152- private final OperationBuilder operationParser ;
152+ private final OperationService operationParser ;
153153
154154 /**
155155 * The Open api customisers.
@@ -184,17 +184,17 @@ public abstract class AbstractOpenApiResource extends SpecFilter {
184184 * @param springDocConfigProperties the spring doc config properties
185185 * @param actuatorProvider the actuator provider
186186 */
187- protected AbstractOpenApiResource (String groupName , ObjectFactory <OpenAPIBuilder > openAPIBuilderObjectFactory ,
188- AbstractRequestBuilder requestBuilder ,
189- GenericResponseBuilder responseBuilder , OperationBuilder operationParser ,
187+ protected AbstractOpenApiResource (String groupName , ObjectFactory <OpenAPIService > openAPIBuilderObjectFactory ,
188+ AbstractRequestService requestBuilder ,
189+ GenericResponseService responseBuilder , OperationService operationParser ,
190190 Optional <List <OperationCustomizer >> operationCustomizers ,
191191 Optional <List <OpenApiCustomiser >> openApiCustomisers ,
192192 SpringDocConfigProperties springDocConfigProperties ,
193193 Optional <ActuatorProvider > actuatorProvider ) {
194194 super ();
195195 this .groupName = Objects .requireNonNull (groupName , "groupName" );
196196 this .openAPIBuilderObjectFactory = openAPIBuilderObjectFactory ;
197- this .openAPIBuilder = openAPIBuilderObjectFactory .getObject ();
197+ this .openAPIService = openAPIBuilderObjectFactory .getObject ();
198198 this .requestBuilder = requestBuilder ;
199199 this .responseBuilder = responseBuilder ;
200200 this .operationParser = operationParser ;
@@ -251,44 +251,44 @@ public static void addHiddenRestControllers(String... classes) {
251251 */
252252 protected synchronized OpenAPI getOpenApi () {
253253 OpenAPI openApi ;
254- if (openAPIBuilder .getCachedOpenAPI () == null || springDocConfigProperties .isCacheDisabled ()) {
254+ if (openAPIService .getCachedOpenAPI () == null || springDocConfigProperties .isCacheDisabled ()) {
255255 Instant start = Instant .now ();
256- openAPIBuilder .build ();
257- Map <String , Object > mappingsMap = openAPIBuilder .getMappingsMap ().entrySet ().stream ()
256+ openAPIService .build ();
257+ Map <String , Object > mappingsMap = openAPIService .getMappingsMap ().entrySet ().stream ()
258258 .filter (controller -> (AnnotationUtils .findAnnotation (controller .getValue ().getClass (),
259259 Hidden .class ) == null ))
260260 .filter (controller -> !AbstractOpenApiResource .isHiddenRestControllers (controller .getValue ().getClass ()))
261261 .collect (Collectors .toMap (Map .Entry ::getKey , Map .Entry ::getValue , (a1 , a2 ) -> a1 ));
262262
263- Map <String , Object > findControllerAdvice = openAPIBuilder .getControllerAdviceMap ();
263+ Map <String , Object > findControllerAdvice = openAPIService .getControllerAdviceMap ();
264264 // calculate generic responses
265- openApi = openAPIBuilder .getCalculatedOpenAPI ();
265+ openApi = openAPIService .getCalculatedOpenAPI ();
266266 if (springDocConfigProperties .isOverrideWithGenericResponse () && !CollectionUtils .isEmpty (findControllerAdvice )) {
267267 if (!CollectionUtils .isEmpty (mappingsMap ))
268268 findControllerAdvice .putAll (mappingsMap );
269269 responseBuilder .buildGenericResponse (openApi .getComponents (), findControllerAdvice );
270270 }
271271 getPaths (mappingsMap );
272272 if (!CollectionUtils .isEmpty (openApi .getServers ()))
273- openAPIBuilder .setServersPresent (true );
274- openAPIBuilder .updateServers (openApi );
273+ openAPIService .setServersPresent (true );
274+ openAPIService .updateServers (openApi );
275275
276276 if (springDocConfigProperties .isRemoveBrokenReferenceDefinitions ())
277277 this .removeBrokenReferenceDefinitions (openApi );
278278
279279 // run the optional customisers
280280 openApiCustomisers .ifPresent (apiCustomisers -> apiCustomisers .forEach (openApiCustomiser -> openApiCustomiser .customise (openApi )));
281281
282- openAPIBuilder .setCachedOpenAPI (openApi );
283- openAPIBuilder .resetCalculatedOpenAPI ();
282+ openAPIService .setCachedOpenAPI (openApi );
283+ openAPIService .resetCalculatedOpenAPI ();
284284
285285 LOGGER .info ("Init duration for springdoc-openapi is: {} ms" ,
286286 Duration .between (start , Instant .now ()).toMillis ());
287287 }
288288 else {
289- if (!CollectionUtils .isEmpty (openAPIBuilder .getCachedOpenAPI ().getServers ()))
290- openAPIBuilder .setServersPresent (true );
291- openApi = openAPIBuilder .updateServers (openAPIBuilder .getCachedOpenAPI ());
289+ if (!CollectionUtils .isEmpty (openAPIService .getCachedOpenAPI ().getServers ()))
290+ openAPIService .setServersPresent (true );
291+ openApi = openAPIService .updateServers (openAPIService .getCachedOpenAPI ());
292292 }
293293 return openApi ;
294294 }
@@ -315,7 +315,7 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router
315315 String [] headers = routerOperation .getHeaders ();
316316 Map <String , String > queryParams = routerOperation .getQueryParams ();
317317
318- OpenAPI openAPI = openAPIBuilder .getCalculatedOpenAPI ();
318+ OpenAPI openAPI = openAPIService .getCalculatedOpenAPI ();
319319 Components components = openAPI .getComponents ();
320320 Paths paths = openAPI .getPaths ();
321321
@@ -361,7 +361,7 @@ protected void calculatePath(HandlerMethod handlerMethod, RouterOperation router
361361 fillParametersList (operation , queryParams , methodAttributes );
362362
363363 // compute tags
364- operation = openAPIBuilder .buildTags (handlerMethod , operation , openAPI );
364+ operation = openAPIService .buildTags (handlerMethod , operation , openAPI );
365365
366366 io .swagger .v3 .oas .annotations .parameters .RequestBody requestBodyDoc = AnnotatedElementUtils .findMergedAnnotation (method ,
367367 io .swagger .v3 .oas .annotations .parameters .RequestBody .class );
@@ -411,7 +411,7 @@ private void buildCallbacks(OpenAPI openAPI, MethodAttributes methodAttributes,
411411 * @param routerOperationList the router operation list
412412 */
413413 protected void calculatePath (List <RouterOperation > routerOperationList ) {
414- ApplicationContext applicationContext = openAPIBuilder .getContext ();
414+ ApplicationContext applicationContext = openAPIService .getContext ();
415415 if (!CollectionUtils .isEmpty (routerOperationList )) {
416416 Collections .sort (routerOperationList );
417417 for (RouterOperation routerOperation : routerOperationList ) {
@@ -464,7 +464,7 @@ protected void calculatePath(RouterOperation routerOperation) {
464464 String [] headers = routerOperation .getHeaders ();
465465 Map <String , String > queryParams = routerOperation .getQueryParams ();
466466
467- OpenAPI openAPI = openAPIBuilder .getCalculatedOpenAPI ();
467+ OpenAPI openAPI = openAPIService .getCalculatedOpenAPI ();
468468 Paths paths = openAPI .getPaths ();
469469 Map <HttpMethod , Operation > operationMap = null ;
470470 if (paths .containsKey (operationPath )) {
@@ -516,7 +516,7 @@ protected void calculatePath(HandlerMethod handlerMethod, String operationPath,
516516 */
517517 protected void getRouterFunctionPaths (String beanName , AbstractRouterFunctionVisitor routerFunctionVisitor ) {
518518 List <org .springdoc .core .annotations .RouterOperation > routerOperationList = new ArrayList <>();
519- ApplicationContext applicationContext = openAPIBuilder .getContext ();
519+ ApplicationContext applicationContext = openAPIService .getContext ();
520520 RouterOperations routerOperations = applicationContext .findAnnotationOnBean (beanName , RouterOperations .class );
521521 if (routerOperations == null ) {
522522 org .springdoc .core .annotations .RouterOperation routerOperation = applicationContext .findAnnotationOnBean (beanName , org .springdoc .core .annotations .RouterOperation .class );
@@ -839,7 +839,7 @@ private void fillParametersList(Operation operation, Map<String, String> queryPa
839839 List <Parameter > parametersList = operation .getParameters ();
840840 if (parametersList == null )
841841 parametersList = new ArrayList <>();
842- Collection <Parameter > headersMap = AbstractRequestBuilder .getHeaders (methodAttributes , new LinkedHashMap <>());
842+ Collection <Parameter > headersMap = AbstractRequestService .getHeaders (methodAttributes , new LinkedHashMap <>());
843843 parametersList .addAll (headersMap );
844844 if (!CollectionUtils .isEmpty (queryParams )) {
845845 for (Map .Entry <String , String > entry : queryParams .entrySet ()) {
@@ -848,7 +848,7 @@ private void fillParametersList(Operation operation, Map<String, String> queryPa
848848 parameter .setSchema (new StringSchema ()._default (entry .getValue ()));
849849 parameter .setRequired (true );
850850 parameter .setIn (ParameterIn .QUERY .toString ());
851- GenericParameterBuilder .mergeParameter (parametersList , parameter );
851+ GenericParameterService .mergeParameter (parametersList , parameter );
852852 }
853853 operation .setParameters (parametersList );
854854 }
@@ -992,8 +992,8 @@ else if (existingOperation != null) {
992992 * Init open api builder.
993993 */
994994 protected void initOpenAPIBuilder () {
995- if (openAPIBuilder .getCachedOpenAPI () != null && springDocConfigProperties .isCacheDisabled ()) {
996- openAPIBuilder = openAPIBuilderObjectFactory .getObject ();
995+ if (openAPIService .getCachedOpenAPI () != null && springDocConfigProperties .isCacheDisabled ()) {
996+ openAPIService = openAPIBuilderObjectFactory .getObject ();
997997 }
998998 }
999999
0 commit comments