From 11d5611c37a32c1517e44c1549eef6fb0792f285 Mon Sep 17 00:00:00 2001 From: Thim Date: Mon, 9 Sep 2024 13:28:39 +0200 Subject: [PATCH 1/3] Fix undefined example.$ref --- libV2/schemaUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libV2/schemaUtils.js b/libV2/schemaUtils.js index ea828681..77ba2f54 100644 --- a/libV2/schemaUtils.js +++ b/libV2/schemaUtils.js @@ -469,7 +469,7 @@ let QUERYPARAM = 'query', exampleKey = Object.keys(exampleObj)[0]; example = exampleObj[exampleKey]; - if (example.$ref) { + if (example && example.$ref) { example = resolveExampleData(context, example); } From 7f9f85ca092aa41c82c4d4b293732a7d06ec5b4a Mon Sep 17 00:00:00 2001 From: Thim Date: Mon, 9 Sep 2024 14:09:10 +0200 Subject: [PATCH 2/3] Throw fatal error to allow error handling in module usage --- libV2/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libV2/index.js b/libV2/index.js index 1c3ce5af..dec00724 100644 --- a/libV2/index.js +++ b/libV2/index.js @@ -104,7 +104,7 @@ module.exports = { } catch (error) { console.error(error); - break; + throw error; } collection.variable.push(...collectionVariables); From af57d1cff1d567b9840859f18ca87834b5e42946 Mon Sep 17 00:00:00 2001 From: Thim Date: Mon, 9 Sep 2024 15:50:44 +0200 Subject: [PATCH 3/3] Revert back --- libV2/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libV2/index.js b/libV2/index.js index dec00724..1c3ce5af 100644 --- a/libV2/index.js +++ b/libV2/index.js @@ -104,7 +104,7 @@ module.exports = { } catch (error) { console.error(error); - throw error; + break; } collection.variable.push(...collectionVariables);