From 59dc8a11de4cc74283986cd412ca2537b52caf1c Mon Sep 17 00:00:00 2001 From: Aakanksha Date: Fri, 11 Oct 2024 15:05:55 +0530 Subject: [PATCH 1/2] Fixed bug for request body not resolving schema when using Signed-off-by: Aakanksha --- lib/schemaUtils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/schemaUtils.js b/lib/schemaUtils.js index 2a6f7ad0a..ec19f7156 100644 --- a/lib/schemaUtils.js +++ b/lib/schemaUtils.js @@ -2129,6 +2129,10 @@ module.exports = { rDataMode = 'raw'; let bodyType, language; + if (contentObj[FORM_DATA].hasOwnProperty('schema') && contentObj[FORM_DATA].schema.hasOwnProperty('$ref')) { + contentObj[FORM_DATA].schema = this.getRefObject(contentObj[FORM_DATA].schema.$ref, components, options); + } + // checking for all possible raw types if (contentObj.hasOwnProperty(APP_JS)) { bodyType = APP_JS; } else if (contentObj.hasOwnProperty(APP_JSON)) { bodyType = APP_JSON; } From 85965808e58a0bf2389ddf17aae017699d0f14a7 Mon Sep 17 00:00:00 2001 From: Aakanksha Date: Fri, 11 Oct 2024 15:07:34 +0530 Subject: [PATCH 2/2] Fixed bug Signed-off-by: Aakanksha --- lib/schemaUtils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/schemaUtils.js b/lib/schemaUtils.js index ec19f7156..c80668ba9 100644 --- a/lib/schemaUtils.js +++ b/lib/schemaUtils.js @@ -2129,8 +2129,8 @@ module.exports = { rDataMode = 'raw'; let bodyType, language; - if (contentObj[FORM_DATA].hasOwnProperty('schema') && contentObj[FORM_DATA].schema.hasOwnProperty('$ref')) { - contentObj[FORM_DATA].schema = this.getRefObject(contentObj[FORM_DATA].schema.$ref, components, options); + if (contentObj.hasOwnProperty('schema') && contentObj.schema.hasOwnProperty('$ref')) { + contentObj.schema = this.getRefObject(contentObj.schema.$ref, components, options); } // checking for all possible raw types