From c5e83946729865a037eddbf9b82f9194542d3102 Mon Sep 17 00:00:00 2001 From: Luis Tejeda <46000487+LuisTejedaS@users.noreply.github.com> Date: Wed, 2 Feb 2022 16:28:51 -0600 Subject: [PATCH] Update schemaUtils31X.js refactoring --- lib/31XUtils/schemaUtils31X.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/31XUtils/schemaUtils31X.js b/lib/31XUtils/schemaUtils31X.js index 326ca4d..7276a67 100644 --- a/lib/31XUtils/schemaUtils31X.js +++ b/lib/31XUtils/schemaUtils31X.js @@ -96,14 +96,8 @@ module.exports = { if (hasExamplesInRoot && typeIsAnArray) { let foundType = this.findTypeByExample(schema.examples[0], schema.type); - if (foundType) { - schema.type = foundType; - schema.example = schema.examples[0]; - } - else { - schema.type = schema.type[0]; - schema.example = schema.examples[0]; - } + schema.type = foundType ? foundType : schema.type[0]; + schema.example = schema.examples[0]; } if (hasExamplesInRoot && !typeIsAnArray) {