public void applyBeanValidatorAnnotations(final RequestBody requestBody, final List<Annotation> annotations, boolean isOptional) {
		Map<String, Annotation> annos = new HashMap<>();
		boolean springRequestBodyRequired = false;
		boolean swaggerRequestBodyRequired = false;
		if (!CollectionUtils.isEmpty(annotations)) {
			annotations.forEach(annotation -> annos.put(annotation.annotationType().getSimpleName(), annotation));
			springRequestBodyRequired = annotations.stream()
					.filter(annotation -> org.springframework.web.bind.annotation.RequestBody.class.equals(annotation.annotationType()))
					.anyMatch(annotation -> ((org.springframework.web.bind.annotation.RequestBody) annotation).required());
			swaggerRequestBodyRequired = annotations.stream()
					.filter(annotation -> io.swagger.v3.oas.annotations.parameters.RequestBody.class.equals(annotation.annotationType()))
					.anyMatch(annotation -> ((io.swagger.v3.oas.annotations.parameters.RequestBody) annotation).required());
		}
		boolean validationExists = SchemaUtils.annotatedNotNull(annos.values().stream().toList());

		if (validationExists || (!isOptional && (springRequestBodyRequired || swaggerRequestBodyRequired)))
			requestBody.setRequired(true);
	}
Apply bean validator annotations.

@param requestBody the request body
@param annotations the annotations
@param isOptional  the is optional
springdoc-openapi-starter-common/src/main/java/org/springdoc/core/service/AbstractRequestService.java