private Map<String, ApiResponse> getGenericMapResponse(HandlerMethod handlerMethod) {
		reentrantLock.lock();
		try {
			Class<?> beanType = handlerMethod.getBeanType();
			List<ControllerAdviceInfo> controllerAdviceInfosInThisBean = localExceptionHandlers.stream()
					.filter(controllerInfo -> {
						Class<?> objClz = controllerInfo.getControllerAdvice().getClass();
						if (AopUtils.isAopProxy(controllerInfo.getControllerAdvice()))
							objClz = AopUtils.getTargetClass(controllerInfo.getControllerAdvice());
						return beanType.equals(objClz);
					})
					.toList();

			Map<String, ApiResponse> genericApiResponseMap = controllerAdviceInfosInThisBean.stream()
					.map(ControllerAdviceInfo::getApiResponseMap)
					.collect(LinkedHashMap::new, Map::putAll, Map::putAll);

			List<ControllerAdviceInfo> controllerAdviceInfosNotInThisBean = controllerAdviceInfos.stream()
					.filter(controllerAdviceInfo ->
							getControllerAdviceBean(controllerAdviceBeans, controllerAdviceInfo.getControllerAdvice())
									.isApplicableToBeanType(beanType))
					.filter(controllerAdviceInfo -> !beanType.equals(controllerAdviceInfo.getControllerAdvice().getClass()))
					.toList();

			Class<?>[] methodExceptions = handlerMethod.getMethod().getExceptionTypes();

			for (ControllerAdviceInfo controllerAdviceInfo : controllerAdviceInfosNotInThisBean) {
				List<MethodAdviceInfo> methodAdviceInfos = controllerAdviceInfo.getMethodAdviceInfos();
				for (MethodAdviceInfo methodAdviceInfo : methodAdviceInfos) {
					Set<Class<?>> exceptions = methodAdviceInfo.getExceptions();
					boolean addToGenericMap = false;

					for (Class<?> exception : exceptions) {
						if (isGlobalException(exception) ||
								Arrays.stream(methodExceptions).anyMatch(methodException ->
										methodException.isAssignableFrom(exception) ||
												exception.isAssignableFrom(methodException))) {

							addToGenericMap = true;
							break;
						}
					}

					if (addToGenericMap || exceptions.isEmpty()) {
						methodAdviceInfo.getApiResponses().forEach((key, apiResponse) -> {
							if (!genericApiResponseMap.containsKey(key))
								genericApiResponseMap.put(key, apiResponse);
						});
					}
				}
			}

			LinkedHashMap<String, ApiResponse> genericApiResponsesClone;
			try {
				ObjectMapper objectMapper = ObjectMapperProvider.createJson(springDocConfigProperties);
				genericApiResponsesClone = objectMapper.readValue(objectMapper.writeValueAsString(genericApiResponseMap), ApiResponses.class);
				return genericApiResponsesClone;
			}
			catch (JsonProcessingException e) {
				LOGGER.warn("Json Processing Exception occurred: {}", e.getMessage());
				return genericApiResponseMap;
			}
		}
		finally {
			reentrantLock.unlock();
		}
	}
Gets generic map response.

@param handlerMethod the handler method
@return the generic map response
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java