private static MediaType getMediaType(Schema schema, Components components, JsonView jsonViewAnnotation,
			io.swagger.v3.oas.annotations.media.Content annotationContent, boolean openapi31) {
		MediaType mediaType = new MediaType();
		if (annotationContent.schema().hidden()) {
			return mediaType;
		}
		if (components == null) {
			mediaType.setSchema(schema);
			return mediaType;
		}
		try {
			getSchema(annotationContent, components, jsonViewAnnotation, openapi31).ifPresent(mediaType::setSchema);
			if (annotationContent.schemaProperties().length > 0) {
				if (mediaType.getSchema() == null) {
					mediaType.schema(new ObjectSchema());
				}
				Schema oSchema = mediaType.getSchema();
				for (SchemaProperty sp : annotationContent.schemaProperties()) {
					Class<?> schemaImplementation = sp.schema().implementation();
					boolean isArray = false;
					if (schemaImplementation == Void.class) {
						schemaImplementation = sp.array().schema().implementation();
						if (schemaImplementation != Void.class) {
							isArray = true;
						}
					}
					getSchema(sp.schema(), sp.array(), isArray, schemaImplementation, components, jsonViewAnnotation, openapi31)
							.ifPresent(s -> {
								if ("array".equals(oSchema.getType())) {
									oSchema.getItems().addProperty(sp.name(), s);
								}
								else {
									oSchema.addProperty(sp.name(), s);
								}
							});
				}
			}
			if (
					hasSchemaAnnotation(annotationContent.additionalPropertiesSchema()) &&
							mediaType.getSchema() != null &&
							!Boolean.TRUE.equals(mediaType.getSchema().getAdditionalProperties()) &&
							!Boolean.FALSE.equals(mediaType.getSchema().getAdditionalProperties())) {
				getSchemaFromAnnotation(annotationContent.additionalPropertiesSchema(), components, jsonViewAnnotation, openapi31)
						.ifPresent(s -> {
									if ("array".equals(mediaType.getSchema().getType())) {
										mediaType.getSchema().getItems().additionalProperties(s);
									}
									else {
										mediaType.getSchema().additionalProperties(s);
									}
								}
						);
			}
		}
		catch (Exception e) {
			if (isArray(annotationContent))
				mediaType.setSchema(new ArraySchema().items(new StringSchema()));
			else
				mediaType.setSchema(new StringSchema());
		}
		return mediaType;
	}
Gets media type.

@param schema             the schema
@param components         the components
@param jsonViewAnnotation the json view annotation
@param annotationContent  the annotation content
@param openapi31          the openapi 31
@return the media type
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/utils/SpringDocAnnotationsUtils.java