diff --git a/src/main/java/io/swagger/oas/inflector/controllers/OpenAPIOperationController.java b/src/main/java/io/swagger/oas/inflector/controllers/OpenAPIOperationController.java index 339e9def..7a07a8a4 100644 --- a/src/main/java/io/swagger/oas/inflector/controllers/OpenAPIOperationController.java +++ b/src/main/java/io/swagger/oas/inflector/controllers/OpenAPIOperationController.java @@ -363,6 +363,16 @@ public Response apply(ContainerRequestContext ctx) { } } + } else if (operation.getRequestBody().getRequired()) { + ValidationException e = new ValidationException(); + e.message(new ValidationMessage() + .message("The input body `" + operation.getRequestBody() + "` is required but was provided with an unsupported media type `" + + mediaType + "`")); + try { + throw e; + } catch (ValidationException e1) { + missingParams.add(e.getValidationMessage()); + } } } catch (ConversionException e) { missingParams.add(e.getError());