private void buildGenericApiResponses(Components components, MethodParameter methodParameter, ApiResponses apiResponsesOp,
			MethodAttributes methodAttributes) {
		ApiResponse apiResponse = null;
		if (!CollectionUtils.isEmpty(apiResponsesOp)) {
			// API Responses at operation and @ApiResponse annotation
			for (Entry<String, ApiResponse> entry : apiResponsesOp.entrySet()) {
				String httpCode = entry.getKey();
				apiResponse = entry.getValue();
				buildApiResponses(components, methodParameter, apiResponsesOp, methodAttributes, httpCode, apiResponse, true);
			}
		}
		else {
			// Use response parameters with no description filled - No documentation
			// available
			String httpCode = evaluateResponseStatus(methodParameter.getMethod(), Objects.requireNonNull(methodParameter.getMethod()).getClass(), true);
			if (Objects.nonNull(httpCode)) {
				apiResponse = methodAttributes.getGenericMapResponse().containsKey(httpCode) ? methodAttributes.getGenericMapResponse().get(httpCode)
						: new ApiResponse();
				buildApiResponses(components, methodParameter, apiResponsesOp, methodAttributes, httpCode, apiResponse, true);
			}
		}
		if (apiResponse != null) {
			Content content = apiResponse.getContent();
			if (content != null) {
				String defaultProducesMediaType = springDocConfigProperties.getDefaultProducesMediaType();
				io.swagger.v3.oas.models.media.MediaType mediaType = content.get(defaultProducesMediaType);
				if (mediaType != null && ProblemDetail.class.isAssignableFrom(methodParameter.getParameterType())) {
					content.addMediaType(MediaType.APPLICATION_PROBLEM_JSON_VALUE, mediaType);
					content.remove(defaultProducesMediaType);
				}
			}
		}
	}
Build generic api responses.

@param components       the components
@param methodParameter  the method parameter
@param apiResponsesOp   the api responses op
@param methodAttributes the method attributes
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/GenericResponseService.java