private void updateApiResponse(OpenAPI openAPI, Components components, ApiResponse apiResponse, boolean openapi31) {
		if (apiResponse != null && !CollectionUtils.isEmpty(apiResponse.getContent())) {
			apiResponse.getContent().values().forEach(mediaType -> {
				Schema schema = mediaType.getSchema();
				if (schema.get$ref() != null && !schema.get$ref().endsWith(RESPONSE)) {
					String key = schema.get$ref().substring(Components.COMPONENTS_SCHEMAS_REF.length());
					Set<String> entitiesNames = entityInoMap.keySet();
					entitiesNames.forEach(entityName -> {
						if (key.endsWith(entityName))
							updateResponseSchema(entityName, components.getSchemas().get(key), openAPI.getComponents(), openapi31);
					});
				}
			});
		}
	}
Update api response.

@param openAPI     the open api
@param components  the components
@param apiResponse the api response
@param openapi31   the openapi 31
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocDataRestUtils.java