public void buildGenericResponse(Components components, Map<String, Object> findControllerAdvice, Locale locale) {
		// ControllerAdvice
		for (Entry<String, Object> entry : findControllerAdvice.entrySet()) {
			List<Method> methods = new ArrayList<>();
			Object controllerAdvice = entry.getValue();
			// get all methods with annotation @ExceptionHandler
			Class<?> objClz = controllerAdvice.getClass();
			if (AopUtils.isAopProxy(controllerAdvice))
				objClz = AopUtils.getTargetClass(controllerAdvice);
			ControllerAdviceInfo controllerAdviceInfo = new ControllerAdviceInfo(controllerAdvice);
			Arrays.stream(ReflectionUtils.getAllDeclaredMethods(objClz))
					.filter(m -> m.isAnnotationPresent(ExceptionHandler.class)
							|| isResponseEntityExceptionHandlerMethod(m)
					).forEach(methods::add);
			// for each one build ApiResponse and add it to existing responses
			for (Method method : methods) {
				if (!operationService.isHidden(method)) {
					RequestMapping reqMappingMethod = AnnotatedElementUtils.findMergedAnnotation(method, RequestMapping.class);
					String[] methodProduces = { springDocConfigProperties.getDefaultProducesMediaType() };
					if (reqMappingMethod != null)
						methodProduces = reqMappingMethod.produces();
					MethodParameter methodParameter = new MethodParameter(method, -1);
					MethodAdviceInfo methodAdviceInfo = new MethodAdviceInfo(method);
					controllerAdviceInfo.addMethodAdviceInfos(methodAdviceInfo);
					// get exceptions lists
					Set<Class<?>> exceptions = getExceptionsFromExceptionHandler(methodParameter);
					methodAdviceInfo.setExceptions(exceptions);
					Map<String, ApiResponse> controllerAdviceInfoApiResponseMap = controllerAdviceInfo.getApiResponseMap();
					ApiResponses apiResponsesOp = new ApiResponses();
					MethodAttributes methodAttributes = new MethodAttributes(methodProduces, springDocConfigProperties.getDefaultConsumesMediaType(),
							springDocConfigProperties.getDefaultProducesMediaType(), controllerAdviceInfoApiResponseMap, locale);
					//calculate JsonView Annotation
					methodAttributes.setJsonViewAnnotation(AnnotatedElementUtils.findMergedAnnotation(method, JsonView.class));
					//use the javadoc return if present
					if (operationService.getJavadocProvider() != null) {
						JavadocProvider javadocProvider = operationService.getJavadocProvider();
						methodAttributes.setJavadocReturn(javadocProvider.getMethodJavadocReturn(methodParameter.getMethod()));
					}
					computeResponseFromDoc(components, methodParameter, apiResponsesOp, methodAttributes, springDocConfigProperties.isOpenapi31(), locale);
					buildGenericApiResponses(components, methodParameter, apiResponsesOp, methodAttributes);
					methodAdviceInfo.setApiResponses(apiResponsesOp);
				}
			}
			if (AnnotatedElementUtils.hasAnnotation(objClz, ControllerAdvice.class)) {
				controllerAdviceInfos.add(controllerAdviceInfo);
			}
			else {
				localExceptionHandlers.add(controllerAdviceInfo);
			}
		}
	}
Build generic response.

@param components           the components
@param findControllerAdvice the find controller advice
@param locale               the locale
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java