diff --git a/src/middlewares/openapi.request.validator.ts b/src/middlewares/openapi.request.validator.ts index 543a3eb2..515874ac 100644 --- a/src/middlewares/openapi.request.validator.ts +++ b/src/middlewares/openapi.request.validator.ts @@ -242,7 +242,7 @@ export class RequestValidator { throw validationError(415, path, msg); } - let bodyContentSchema = + const bodyContentSchema = requestBody.content[contentType.contentType] && requestBody.content[contentType.contentType].schema; if (bodyContentSchema && '$ref' in bodyContentSchema) {