Repository: cdimascio/express-openapi-validator
Pull request #945 (2024-08-06 09:10:42)

[Snyk] Upgrade ajv from 8.15.0 to 8.17.1
![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)


<h3>Snyk has created this PR to upgrade ajv from 8.15.0 to 8.17.1.</h3>

:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.

<hr/>


- The recommended version is **2 versions** ahead of your current version.

- The recommended version was released on **25 days ago**.



<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>ajv</b></summary>
    <ul>
      <li>
        <b>8.17.1</b> - <a href="https://github.com/ajv-validator/ajv/releases/tag/v8.17.1">2024-07-12</a></br><h2>What's Changed</h2>
<ul>
<li>bump version to 8.17.1 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2401778375" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2472" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2472/hovercard" href="https://github.com/ajv-validator/ajv/pull/2472">#2472</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link" href="https://github.com/ajv-validator/ajv/compare/v8.17.0...v8.17.1"><tt>v8.17.0...v8.17.1</tt></a></p>
<h2>Plus everything in 8.17.0 which failed to release</h2>
<p>The only functional change is to switch from uri-js (which is no longer supported), to fast-uri. This is the second attempt and the team on fast-uri have been really helpful addressing the issues we found last time.</p>
<p>Revert "Revert fast-uri change (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2332044566" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2444" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2444/hovercard" href="https://github.com/ajv-validator/ajv/pull/2444">#2444</a>)" by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/gurgunday/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/gurgunday">@ gurgunday</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2341628872" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2448" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2448/hovercard" href="https://github.com/ajv-validator/ajv/pull/2448">#2448</a><br>
fix: ignore new eslint error for @ typescript-eslint/no-extraneous-class by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2355011590" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2455" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2455/hovercard" href="https://github.com/ajv-validator/ajv/pull/2455">#2455</a><br>
docs: clarify behaviour of addVocabulary by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2354978405" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2454" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2454/hovercard" href="https://github.com/ajv-validator/ajv/pull/2454">#2454</a><br>
docs: refactor to improve legibility by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/blottn/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/blottn">@ blottn</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2290849469" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2432" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2432/hovercard" href="https://github.com/ajv-validator/ajv/pull/2432">#2432</a><br>
Fix grammatical typo in managing-schemas.md by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wetneb/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wetneb">@ wetneb</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1802214926" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2305" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2305/hovercard" href="https://github.com/ajv-validator/ajv/pull/2305">#2305</a><br>
docs: Fix broken strict-mode link by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/alexanderjsx/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/alexanderjsx">@ alexanderjsx</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2376078277" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2459" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2459/hovercard" href="https://github.com/ajv-validator/ajv/pull/2459">#2459</a><br>
feat: add test for encoded refs and bump fast-uri by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2349743940" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2449" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2449/hovercard" href="https://github.com/ajv-validator/ajv/pull/2449">#2449</a><br>
fix: changes for @ typescript-eslint/array-type rule by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2394250920" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2467" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2467/hovercard" href="https://github.com/ajv-validator/ajv/pull/2467">#2467</a><br>
fixes <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1582430966" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2217" data-hovercard-type="issue" data-hovercard-url="/ajv-validator/ajv/issues/2217/hovercard" href="https://github.com/ajv-validator/ajv/issues/2217">#2217</a> - clarify custom keyword naming by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2367894003" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2457" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2457/hovercard" href="https://github.com/ajv-validator/ajv/pull/2457">#2457</a></p>
      </li>
      <li>
        <b>8.16.0</b> - <a href="https://github.com/ajv-validator/ajv/releases/tag/v8.16.0">2024-06-04</a></br><h2>What's Changed</h2>
<ul>
<li>Revert fast-uri change by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2332044566" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2444" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2444/hovercard" href="https://github.com/ajv-validator/ajv/pull/2444">#2444</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link" href="https://github.com/ajv-validator/ajv/compare/v8.15.0...v8.16.0"><tt>v8.15.0...v8.16.0</tt></a></p>
      </li>
      <li>
        <b>8.15.0</b> - <a href="https://github.com/ajv-validator/ajv/releases/tag/v8.15.0">2024-06-03</a></br><h2>What's Changed</h2>
<ul>
<li>Replace <code>uri-js</code> with <code>fast-uri</code> by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/vixalien/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/vixalien">@ vixalien</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2241730171" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2415" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2415/hovercard" href="https://github.com/ajv-validator/ajv/pull/2415">#2415</a></li>
<li>Bump to 8.15.0 by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jasoniangreen/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jasoniangreen">@ jasoniangreen</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2327394652" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2442" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2442/hovercard" href="https://github.com/ajv-validator/ajv/pull/2442">#2442</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/vixalien/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/vixalien">@ vixalien</a> made their first contribution in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2241730171" data-permission-text="Title is private" data-url="https://github.com/ajv-validator/ajv/issues/2415" data-hovercard-type="pull_request" data-hovercard-url="/ajv-validator/ajv/pull/2415/hovercard" href="https://github.com/ajv-validator/ajv/pull/2415">#2415</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a class="commit-link" href="https://github.com/ajv-validator/ajv/compare/v8.14.0...v8.15.0"><tt>v8.14.0...v8.15.0</tt></a></p>
      </li>
    </ul>
    from <a href="https://github.com/ajv-validator/ajv/releases">ajv GitHub release notes</a>
  </details>
</details>

---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with your project.
> - This PR was automatically created by Snyk using the credentials of a real user.

---

**Note:** _You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs._

**For more information:** <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI3YzlkMWYxYS1mOGNiLTQ5ZjAtODkxZS1hNzgzZWM3MzA1YWUiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjdjOWQxZjFhLWY4Y2ItNDlmMC04OTFlLWE3ODNlYzczMDVhZSJ9fQ==" width="0" height="0"/>

> - 🧐 [View latest project report](https://app.snyk.io/org/cdimascio/project/f63fb44e-f154-45ba-b1f0-20d49ea578ce?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates)
> - 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/cdimascio/project/f63fb44e-f154-45ba-b1f0-20d49ea578ce/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/cdimascio/project/f63fb44e-f154-45ba-b1f0-20d49ea578ce/settings/integration?pkg&#x3D;ajv&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

[//]: # 'snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"ajv","from":"8.15.0","to":"8.17.1"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"7c9d1f1a-f8cb-49f0-891e-a783ec7305ae","prPublicId":"7c9d1f1a-f8cb-49f0-891e-a783ec7305ae","packageManager":"npm","priorityScoreList":[],"projectPublicId":"f63fb44e-f154-45ba-b1f0-20d49ea578ce","projectUrl":"https://app.snyk.io/org/cdimascio/project/f63fb44e-f154-45ba-b1f0-20d49ea578ce?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2024-07-12T20:42:13.485Z"},"vulns":[]}'



Patch:
diff --git a/CHANGE_HISTORY.md b/CHANGE_HISTORY.md
index 1efdb70..c886f98 100644
--- a/CHANGE_HISTORY.md
+++ b/CHANGE_HISTORY.md
@@ -1,3 +1,10 @@
+##  (2024-08-24)
+
+* fix: correct security schema logic for OR verification (#946) ([2265a10](https://github.com/cdimascio/express-openapi-validator/commit/2265a10)), closes [#946](https://github.com/cdimascio/express-openapi-validator/issues/946)
+* fix: upgrade express-openapi-validator from 5.1.6 to 5.2.0 (#944) ([f022d21](https://github.com/cdimascio/express-openapi-validator/commit/f022d21)), closes [#944](https://github.com/cdimascio/express-openapi-validator/issues/944)
+
+
+
 ##  (2024-08-05)
 
 * Stripped query params for req.url branch arm (#942) ([26d06c4](https://github.com/cdimascio/express-openapi-validator/commit/26d06c4)), closes [#942](https://github.com/cdimascio/express-openapi-validator/issues/942)
diff --git a/examples/8-top-level-discriminator/package-lock.json b/examples/8-top-level-discriminator/package-lock.json
index 23b2e22..e1e2a1f 100644
--- a/examples/8-top-level-discriminator/package-lock.json
+++ b/examples/8-top-level-discriminator/package-lock.json
@@ -17,24 +17,23 @@
       }
     },
     "../..": {
-      "version": "5.0.5",
+      "name": "express-openapi-validator",
+      "version": "5.2.0",
       "license": "MIT",
       "dependencies": {
-        "@apidevtools/json-schema-ref-parser": "^9.1.2",
-        "@types/multer": "^1.4.7",
-        "ajv": "^8.11.2",
+        "@apidevtools/json-schema-ref-parser": "^11.6.2",
+        "@types/multer": "^1.4.11",
+        "ajv": "^8.14.0",
         "ajv-draft-04": "^1.0.0",
         "ajv-formats": "^2.1.1",
         "content-type": "^1.0.5",
         "json-schema-traverse": "^1.0.0",
         "lodash.clonedeep": "^4.5.0",
         "lodash.get": "^4.4.2",
-        "lodash.uniq": "^4.5.0",
-        "lodash.zipobject": "^4.1.3",
         "media-typer": "^1.1.0",
         "multer": "^1.4.5-lts.1",
         "ono": "^7.1.3",
-        "path-to-regexp": "^6.2.0"
+        "path-to-regexp": "^6.2.2"
       },
       "devDependencies": {
         "@types/cookie-parser": "^1.4.2",
@@ -45,20 +44,23 @@
         "@types/supertest": "^2.0.11",
         "body-parser": "^1.19.2",
         "chai": "^4.3.6",
-        "codacy-coverage": "^3.4.0",
         "commitizen": "^4.2.5",
         "cookie-parser": "^1.4.6",
         "coveralls": "^3.1.1",
-        "express": "^4.17.3",
+        "express": "^4.19.2",
         "mocha": "^9.2.2",
         "morgan": "^1.10.0",
-        "nodemon": "^2.0.20",
+        "nodemon": "^3.0.1",
         "nyc": "^15.1.0",
         "prettier": "^2.5.1",
+        "rimraf": "^5.0.5",
         "source-map-support": "0.5.21",
         "supertest": "^6.2.2",
         "ts-node": "^10.7.0",
         "typescript": "^4.6.2"
+      },
+      "peerDependencies": {
+        "express": "*"
       }
     },
     "../../node_modules/@apidevtools/json-schema-ref-parser": {
@@ -989,12 +991,6 @@
         "node": ">= 6"
       }
     },
-    "../../node_modules/bluebird": {
-      "version": "3.5.3",
-      "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
-      "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==",
-      "dev": true
-    },
     "../../node_modules/body-parser": {
       "version": "1.20.2",
       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
@@ -1042,12 +1038,12 @@
       }
     },
     "../../node_modules/braces": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
-      "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
       "dev": true,
       "dependencies": {
-        "fill-range": "^7.0.1"
+        "fill-range": "^7.1.1"
       },
       "engines": {
         "node": ">=8"
@@ -1302,23 +1298,6 @@
         "node": ">=0.8"
       }
     },
-    "../../node_modules/codacy-coverage": {
-      "version": "3.4.0",
-      "resolved": "https://registry.npmjs.org/codacy-coverage/-/codacy-coverage-3.4.0.tgz",
-      "integrity": "sha512-A0ats3/gZtOw76muu++HZ6QrInztWjjLefkLJmmBpjPfyn6nNwNLoApmGmj3F3dfgl2+o6u5GwPnUBkKdfKXTQ==",
-      "dev": true,
-      "dependencies": {
-        "bluebird": "^3.5.x",
-        "commander": "^2.x",
-        "jacoco-parse": "^2.x",
-        "joi": "^13.x",
-        "lcov-parse": "^1.x",
-        "lodash": "^4.17.4",
-        "log-driver": "^1.x",
-        "request": "^2.88.0",
-        "request-promise": "^4.x"
-      }
-    },
     "../../node_modules/color-convert": {
       "version": "1.9.3",
       "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -1343,12 +1322,6 @@
         "delayed-stream": "~1.0.0"
       }
     },
-    "../../node_modules/commander": {
-      "version": "2.19.0",
-      "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
-      "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
-      "dev": true
-    },
     "../../node_modules/commitizen": {
       "version": "4.3.0",
       "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.0.tgz",
@@ -1717,12 +1690,6 @@
         "wrappy": "1"
       }
     },
-    "../../node_modules/diff": {
-      "version": "3.5.0",
-      "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
-      "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
-      "dev": true
-    },
     "../../node_modules/ecc-jsbn": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -2005,9 +1972,9 @@
       }
     },
     "../../node_modules/fill-range": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
-      "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
       "dev": true,
       "dependencies": {
         "to-regex-range": "^5.0.1"
@@ -2468,12 +2435,6 @@
         "node": ">=8"
       }
     },
-    "../../node_modules/hoek": {
-      "version": "5.0.4",
-      "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz",
-      "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==",
-      "dev": true
-    },
     "../../node_modules/homedir-polyfill": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@@ -2803,15 +2764,6 @@
       "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
       "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
     },
-    "../../node_modules/isemail": {
-      "version": "3.2.0",
-      "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
-      "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
-      "dev": true,
-      "dependencies": {
-        "punycode": "2.x.x"
-      }
-    },
     "../../node_modules/isexe": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -2934,94 +2886,6 @@
         "istanbul-lib-report": "^3.0.0"
       }
     },
-    "../../node_modules/jacoco-parse": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/jacoco-parse/-/jacoco-parse-2.0.1.tgz",
-      "integrity": "sha512-YGhIb2iXuQ4/zNh2zgHd6Z6dqlYwLYH1wfsxtTNQ+jnHH9PhhuMwqOFihXymSI41trxok48LdKkSeDIWs28tYg==",
-      "dev": true,
-      "dependencies": {
-        "mocha": "^5.2.0",
-        "xml2js": "^0.4.9"
-      }
-    },
-    "../../node_modules/jacoco-parse/node_modules/commander": {
-      "version": "2.15.1",
-      "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
-      "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
-      "dev": true
-    },
-    "../../node_modules/jacoco-parse/node_modules/debug": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
-      "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
-      "dev": true,
-      "dependencies": {
-        "ms": "2.0.0"
-      }
-    },
-    "../../node_modules/jacoco-parse/node_modules/glob": {
-      "version": "7.1.2",
-      "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
-      "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
-      "dev": true,
-      "dependencies": {
-        "fs.realpath": "^1.0.0",
-        "inflight": "^1.0.4",
-        "inherits": "2",
-        "once": "^1.3.0",
-        "path-is-absolute": "^1.0.0"
-      }
-    },
-    "../../node_modules/jacoco-parse/node_modules/he": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
-      "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
-      "dev": true
-    },
-    "../../node_modules/jacoco-parse/node_modules/mkdirp": {
-      "version": "0.5.1",
-      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
-      "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
-      "dev": true
-    },
-    "../../node_modules/jacoco-parse/node_modules/mocha": {
-      "version": "5.2.0",
-      "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
-      "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
-      "dev": true,
-      "dependencies": {
-        "browser-stdout": "1.3.1",
-        "commander": "2.15.1",
-        "debug": "3.1.0",
-        "diff": "3.5.0",
-        "escape-string-regexp": "1.0.5",
-        "glob": "7.1.2",
-        "growl": "1.10.5",
-        "he": "1.1.1",
-        "mkdirp": "0.5.1",
-        "supports-color": "5.4.0"
-      }
-    },
-    "../../node_modules/jacoco-parse/node_modules/supports-color": {
-      "version": "5.4.0",
-      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
-      "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
-      "dev": true,
-      "dependencies": {
-        "has-flag": "^3.0.0"
-      }
-    },
-    "../../node_modules/joi": {
-      "version": "13.7.0",
-      "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz",
-      "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==",
-      "dev": true,
-      "dependencies": {
-        "hoek": "5.x.x",
-        "isemail": "3.x.x",
-        "topo": "3.x.x"
-      }
-    },
     "../../node_modules/js-tokens": {
       "version": "4.0.0",
       "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -3163,16 +3027,6 @@
       "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
       "dev": true
     },
-    "../../node_modules/lodash.uniq": {
-      "version": "4.5.0",
-      "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
-      "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M="
-    },
-    "../../node_modules/lodash.zipobject": {
-      "version": "4.1.3",
-      "resolved": "https://registry.npmjs.org/lodash.zipobject/-/lodash.zipobject-4.1.3.tgz",
-      "integrity": "sha1-s5n1q6j/YqdG9peb8gshT5ZNvvg="
-    },
     "../../node_modules/log-driver": {
       "version": "1.2.7",
       "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz",
@@ -4308,27 +4162,6 @@
         "node": ">= 6"
       }
     },
-    "../../node_modules/request-promise": {
-      "version": "4.2.4",
-      "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.4.tgz",
-      "integrity": "sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==",
-      "dev": true,
-      "dependencies": {
-        "bluebird": "^3.5.0",
-        "request-promise-core": "1.1.2",
-        "stealthy-require": "^1.1.1",
-        "tough-cookie": "^2.3.3"
-      }
-    },
-    "../../node_modules/request-promise-core": {
-      "version": "1.1.2",
-      "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz",
-      "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==",
-      "dev": true,
-      "dependencies": {
-        "lodash": "^4.17.11"
-      }
-    },
     "../../node_modules/request/node_modules/qs": {
       "version": "6.5.3",
       "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
@@ -4457,12 +4290,6 @@
       "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
       "dev": true
     },
-    "../../node_modules/sax": {
-      "version": "1.2.4",
-      "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
-      "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
-      "dev": true
-    },
     "../../node_modules/semver": {
       "version": "5.7.2",
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
@@ -4674,12 +4501,6 @@
         "node": ">= 0.8"
       }
     },
-    "../../node_modules/stealthy-require": {
-      "version": "1.1.1",
-      "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
-      "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
-      "dev": true
-    },
     "../../node_modules/streamsearch": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
@@ -4908,21 +4729,6 @@
         "node": ">=0.6"
       }
     },
-    "../../node_modules/topo": {
-      "version": "3.0.3",
-      "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
-      "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
-      "dev": true,
-      "dependencies": {
-        "hoek": "6.x.x"
-      }
-    },
-    "../../node_modules/topo/node_modules/hoek": {
-      "version": "6.1.2",
-      "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.2.tgz",
-      "integrity": "sha512-6qhh/wahGYZHFSFw12tBbJw5fsAhhwrrG/y3Cs0YMTv2WzMnL0oLPnQJjv1QJvEfylRSOFuP+xCu+tdx0tD16Q==",
-      "dev": true
-    },
     "../../node_modules/touch": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
@@ -5247,28 +5053,6 @@
         "typedarray-to-buffer": "^3.1.5"
       }
     },
-    "../../node_modules/xml2js": {
-      "version": "0.4.23",
-      "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
-      "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
-      "dev": true,
-      "dependencies": {
-        "sax": ">=0.6.0",
-        "xmlbuilder": "~11.0.0"
-      },
-      "engines": {
-        "node": ">=4.0.0"
-      }
-    },
-    "../../node_modules/xmlbuilder": {
-      "version": "11.0.1",
-      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
-      "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
-      "dev": true,
-      "engines": {
-        "node": ">=4.0"
-      }
-    },
     "../../node_modules/xtend": {
       "version": "4.0.2",
       "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@@ -5404,12 +5188,12 @@
       }
     },
     "node_modules/braces": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
-      "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
       "dev": true,
       "dependencies": {
-        "fill-range": "^7.0.1"
+        "fill-range": "^7.1.1"
       },
       "engines": {
         "node": ">=8"
@@ -5453,9 +5237,9 @@
       "link": true
     },
     "node_modules/fill-range": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
-      "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
       "dev": true,
       "dependencies": {
         "to-regex-range": "^5.0.1"
@@ -5781,12 +5565,12 @@
       }
     },
     "braces": {
-      "version": "3.0.2",
-      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
-      "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+      "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
       "dev": true,
       "requires": {
-        "fill-range": "^7.0.1"
+        "fill-range": "^7.1.1"
       }
     },
     "chokidar": {
@@ -5814,39 +5598,37 @@
     "express-openapi-validator": {
       "version": "file:../..",
       "requires": {
-        "@apidevtools/json-schema-ref-parser": "^9.1.2",
+        "@apidevtools/json-schema-ref-parser": "^11.6.2",
         "@types/cookie-parser": "^1.4.2",
         "@types/express": "4.17.13",
         "@types/mocha": "^9.1.0",
         "@types/morgan": "^1.9.3",
-        "@types/multer": "^1.4.7",
+        "@types/multer": "^1.4.11",
         "@types/node": "^17.0.21",
         "@types/supertest": "^2.0.11",
-        "ajv": "^8.11.2",
+        "ajv": "^8.14.0",
         "ajv-draft-04": "^1.0.0",
         "ajv-formats": "^2.1.1",
         "body-parser": "^1.19.2",
         "chai": "^4.3.6",
-        "codacy-coverage": "^3.4.0",
         "commitizen": "^4.2.5",
         "content-type": "^1.0.5",
         "cookie-parser": "^1.4.6",
         "coveralls": "^3.1.1",
-        "express": "^4.17.3",
+        "express": "^4.19.2",
         "json-schema-traverse": "^1.0.0",
         "lodash.clonedeep": "^4.5.0",
         "lodash.get": "^4.4.2",
-        "lodash.uniq": "^4.5.0",
-        "lodash.zipobject": "^4.1.3",
         "media-typer": "^1.1.0",
         "mocha": "^9.2.2",
         "morgan": "^1.10.0",
         "multer": "^1.4.5-lts.1",
-        "nodemon": "^2.0.20",
+        "nodemon": "^3.0.1",
         "nyc": "^15.1.0",
         "ono": "^7.1.3",
-        "path-to-regexp": "^6.2.0",
+        "path-to-regexp": "^6.2.2",
         "prettier": "^2.5.1",
+        "rimraf": "^5.0.5",
         "source-map-support": "0.5.21",
         "supertest": "^6.2.2",
         "ts-node": "^10.7.0",
@@ -5854,8 +5636,7 @@
       },
       "dependencies": {
         "@apidevtools/json-schema-ref-parser": {
-          "version": "9.1.2",
-          "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz",
+          "version": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz",
           "integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==",
           "requires": {
             "@jsdevtools/ono": "^7.1.3",
@@ -6372,8 +6153,7 @@
           }
         },
         "@types/multer": {
-          "version": "1.4.7",
-          "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.7.tgz",
+          "version": "https://registry.npmjs.org/@types/multer/-/multer-1.4.7.tgz",
           "integrity": "sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==",
           "requires": {
             "@types/express": "*"
@@ -6714,12 +6494,6 @@
             }
           }
         },
-        "bluebird": {
-          "version": "3.5.3",
-          "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz",
-          "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==",
-          "dev": true
-        },
         "body-parser": {
           "version": "1.20.2",
           "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz",
@@ -6762,12 +6536,12 @@
           }
         },
         "braces": {
-          "version": "3.0.2",
-          "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
-          "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+          "version": "3.0.3",
+          "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+          "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
           "dev": true,
           "requires": {
-            "fill-range": "^7.0.1"
+            "fill-range": "^7.1.1"
           }
         },
         "browser-stdout": {
@@ -6966,23 +6740,6 @@
           "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==",
           "dev": true
         },
-        "codacy-coverage": {
-          "version": "3.4.0",
-          "resolved": "https://registry.npmjs.org/codacy-coverage/-/codacy-coverage-3.4.0.tgz",
-          "integrity": "sha512-A0ats3/gZtOw76muu++HZ6QrInztWjjLefkLJmmBpjPfyn6nNwNLoApmGmj3F3dfgl2+o6u5GwPnUBkKdfKXTQ==",
-          "dev": true,
-          "requires": {
-            "bluebird": "^3.5.x",
-            "commander": "^2.x",
-            "jacoco-parse": "^2.x",
-            "joi": "^13.x",
-            "lcov-parse": "^1.x",
-            "lodash": "^4.17.4",
-            "log-driver": "^1.x",
-            "request": "^2.88.0",
-            "request-promise": "^4.x"
-          }
-        },
         "color-convert": {
           "version": "1.9.3",
           "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -7007,12 +6764,6 @@
             "delayed-stream": "~1.0.0"
           }
         },
-        "commander": {
-          "version": "2.19.0",
-          "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
-          "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
-          "dev": true
-        },
         "commitizen": {
           "version": "4.3.0",
           "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.3.0.tgz",
@@ -7315,12 +7066,6 @@
             "wrappy": "1"
           }
         },
-        "diff": {
-          "version": "3.5.0",
-          "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
-          "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
-          "dev": true
-        },
         "ecc-jsbn": {
           "version": "0.1.2",
           "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
@@ -7405,8 +7150,7 @@
           }
         },
         "express": {
-          "version": "4.18.2",
-          "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
+          "version": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
           "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
           "dev": true,
           "requires": {
@@ -7554,9 +7298,9 @@
           }
         },
         "fill-range": {
-          "version": "7.0.1",
-          "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
-          "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+          "version": "7.1.1",
+          "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+          "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
           "dev": true,
           "requires": {
             "to-regex-range": "^5.0.1"
@@ -7948,12 +7692,6 @@
           "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==",
           "dev": true
         },
-        "hoek": {
-          "version": "5.0.4",
-          "resolved": "https://registry.npmjs.org/hoek/-/hoek-5.0.4.tgz",
-          "integrity": "sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w==",
-          "dev": true
-        },
         "homedir-polyfill": {
           "version": "1.0.3",
           "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@@ -8222,15 +7960,6 @@
           "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
           "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
         },
-        "isemail": {
-          "version": "3.2.0",
-          "resolved": "https://registry.npmjs.org/isemail/-/isemail-3.2.0.tgz",
-          "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==",
-          "dev": true,
-          "requires": {
-            "punycode": "2.x.x"
-          }
-        },
         "isexe": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -8356,96 +8085,6 @@
             "istanbul-lib-report": "^3.0.0"
           }
         },
-        "jacoco-parse": {
-          "version": "2.0.1",
-          "resolved": "https://registry.npmjs.org/jacoco-parse/-/jacoco-parse-2.0.1.tgz",
-          "integrity": "sha512-YGhIb2iXuQ4/zNh2zgHd6Z6dqlYwLYH1wfsxtTNQ+jnHH9PhhuMwqOFihXymSI41trxok48LdKkSeDIWs28tYg==",
-          "dev": true,
-          "requires": {
-            "mocha": "^5.2.0",
-            "xml2js": "^0.4.9"
-          },
-          "dependencies": {
-            "commander": {
-              "version": "2.15.1",
-              "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
-              "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
-              "dev": true
-            },
-            "debug": {
-              "version": "3.1.0",
-              "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
-              "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
-              "dev": true,
-              "requires": {
-                "ms": "2.0.0"
-              }
-            },
-            "glob": {
-              "version": "7.1.2",
-              "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
-              "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
-              "dev": true,
-              "requires": {
-                "fs.realpath": "^1.0.0",
-                "inflight": "^1.0.4",
-                "inherits": "2",
-                "once": "^1.3.0",
-                "path-is-absolute": "^1.0.0"
-              }
-            },
-            "he": {
-              "version": "1.1.1",
-              "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz",
-              "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=",
-              "dev": true
-            },
-            "mkdirp": {
-              "version": "0.5.1",
-              "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
-              "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
-              "dev": true
-            },
-            "mocha": {
-              "version": "5.2.0",
-              "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz",
-              "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
-              "dev": true,
-              "requires": {
-                "browser-stdout": "1.3.1",
-                "commander": "2.15.1",
-                "debug": "3.1.0",
-                "diff": "3.5.0",
-                "escape-string-regexp": "1.0.5",
-                "glob": "7.1.2",
-                "growl": "1.10.5",
-                "he": "1.1.1",
-                "mkdirp": "0.5.1",
-                "supports-color": "5.4.0"
-              }
-            },
-            "supports-color": {
-              "version": "5.4.0",
-              "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
-              "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
-              "dev": true,
-              "requires": {
-                "has-flag": "^3.0.0"
-              }
-            }
-          }
-        },
-        "joi": {
-          "version": "13.7.0",
-          "resolved": "https://registry.npmjs.org/joi/-/joi-13.7.0.tgz",
-          "integrity": "sha512-xuY5VkHfeOYK3Hdi91ulocfuFopwgbSORmIwzcwHKESQhC7w1kD5jaVSPnqDxS2I8t3RZ9omCKAxNwXN5zG1/Q==",
-          "dev": true,
-          "requires": {
-            "hoek": "5.x.x",
-            "isemail": "3.x.x",
-            "topo": "3.x.x"
-          }
-        },
         "js-tokens": {
           "version": "4.0.0",
           "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
@@ -8576,16 +8215,6 @@
           "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=",
           "dev": true
         },
-        "lodash.uniq": {
-          "version": "4.5.0",
-          "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
-          "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M="
-        },
-        "lodash.zipobject": {
-          "version": "4.1.3",
-          "resolved": "https://registry.npmjs.org/lodash.zipobject/-/lodash.zipobject-4.1.3.tgz",
-          "integrity": "sha1-s5n1q6j/YqdG9peb8gshT5ZNvvg="
-        },
         "log-driver": {
           "version": "1.2.7",
           "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz",
@@ -8960,8 +8589,7 @@
           }
         },
         "nodemon": {
-          "version": "2.0.22",
-          "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz",
+          "version": "https://registry.npmjs.org/nodemon/-/nodemon-2.0.22.tgz",
           "integrity": "sha512-B8YqaKMmyuCO7BowF1Z1/mkPqLk6cs/l63Ojtd6otKjMx47Dq1utxfRxcavH1I7VSaL8n5BUaoutadnsX3AAVQ==",
           "dev": true,
           "requires": {
@@ -9362,8 +8990,7 @@
           "dev": true
         },
         "path-to-regexp": {
-          "version": "6.2.0",
-          "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.0.tgz",
+          "version": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.2.0.tgz",
           "integrity": "sha512-f66KywYG6+43afgE/8j/GoiNyygk/bnoCbps++3ErRKsIYkGGupyv07R2Ok5m9i67Iqc+T2g1eAUGUPzWhYTyg=="
         },
         "path-type": {
@@ -9551,27 +9178,6 @@
             }
           }
         },
-        "request-promise": {
-          "version": "4.2.4",
-          "resolved": "https://registry.npmjs.org/request-promise/-/request-promise-4.2.4.tgz",
-          "integrity": "sha512-8wgMrvE546PzbR5WbYxUQogUnUDfM0S7QIFZMID+J73vdFARkFy+HElj4T+MWYhpXwlLp0EQ8Zoj8xUA0he4Vg==",
-          "dev": true,
-          "requires": {
-            "bluebird": "^3.5.0",
-            "request-promise-core": "1.1.2",
-            "stealthy-require": "^1.1.1",
-            "tough-cookie": "^2.3.3"
-          }
-        },
-        "request-promise-core": {
-          "version": "1.1.2",
-          "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz",
-          "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==",
-          "dev": true,
-          "requires": {
-            "lodash": "^4.17.11"
-          }
-        },
         "require-directory": {
           "version": "2.1.1",
           "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
@@ -9681,12 +9287,6 @@
           "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
           "dev": true
         },
-        "sax": {
-          "version": "1.2.4",
-          "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
-          "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
-          "dev": true
-        },
         "semver": {
           "version": "5.7.2",
           "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
@@ -9880,12 +9480,6 @@
           "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
           "dev": true
         },
-        "stealthy-require": {
-          "version": "1.1.1",
-          "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
-          "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=",
-          "dev": true
-        },
         "streamsearch": {
           "version": "1.1.0",
           "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
@@ -10065,23 +9659,6 @@
           "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
           "dev": true
         },
-        "topo": {
-          "version": "3.0.3",
-          "resolved": "https://registry.npmjs.org/topo/-/topo-3.0.3.tgz",
-          "integrity": "sha512-IgpPtvD4kjrJ7CRA3ov2FhWQADwv+Tdqbsf1ZnPUSAtCJ9e1Z44MmoSGDXGk4IppoZA7jd/QRkNddlLJWlUZsQ==",
-          "dev": true,
-          "requires": {
-            "hoek": "6.x.x"
-          },
-          "dependencies": {
-            "hoek": {
-              "version": "6.1.2",
-              "resolved": "https://registry.npmjs.org/hoek/-/hoek-6.1.2.tgz",
-              "integrity": "sha512-6qhh/wahGYZHFSFw12tBbJw5fsAhhwrrG/y3Cs0YMTv2WzMnL0oLPnQJjv1QJvEfylRSOFuP+xCu+tdx0tD16Q==",
-              "dev": true
-            }
-          }
-        },
         "touch": {
           "version": "3.1.0",
           "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz",
@@ -10356,22 +9933,6 @@
             "typedarray-to-buffer": "^3.1.5"
           }
         },
-        "xml2js": {
-          "version": "0.4.23",
-          "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
-          "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
-          "dev": true,
-          "requires": {
-            "sax": ">=0.6.0",
-            "xmlbuilder": "~11.0.0"
-          }
-        },
-        "xmlbuilder": {
-          "version": "11.0.1",
-          "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
-          "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
-          "dev": true
-        },
         "xtend": {
           "version": "4.0.2",
           "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@@ -10460,9 +10021,9 @@
       }
     },
     "fill-range": {
-      "version": "7.0.1",
-      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
-      "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+      "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
       "dev": true,
       "requires": {
         "to-regex-range": "^5.0.1"
diff --git a/examples/9-nestjs/package-lock.json b/examples/9-nestjs/package-lock.json
index aa452c7..642ffdf 100644
--- a/examples/9-nestjs/package-lock.json
+++ b/examples/9-nestjs/package-lock.json
@@ -7509,9 +7509,9 @@
       }
     },
     "node_modules/ws": {
-      "version": "7.5.5",
-      "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
-      "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
+      "version": "7.5.10",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+      "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
       "dev": true,
       "engines": {
         "node": ">=8.3.0"
@@ -13357,9 +13357,9 @@
       }
     },
     "ws": {
-      "version": "7.5.5",
-      "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz",
-      "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==",
+      "version": "7.5.10",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz",
+      "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==",
       "dev": true,
       "requires": {}
     },
diff --git a/package-lock.json b/package-lock.json
index 2853038..21d2811 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,17 +1,17 @@
 {
   "name": "express-openapi-validator",
-  "version": "5.3.1",
+  "version": "5.3.2",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "express-openapi-validator",
-      "version": "5.3.1",
+      "version": "5.3.2",
       "license": "MIT",
       "dependencies": {
-        "@apidevtools/json-schema-ref-parser": "^11.6.4",
+        "@apidevtools/json-schema-ref-parser": "^11.7.0",
         "@types/multer": "^1.4.11",
-        "ajv": "^8.15.0",
+        "ajv": "^8.17.1",
         "ajv-draft-04": "^1.0.0",
         "ajv-formats": "^2.1.1",
         "content-type": "^1.0.5",
@@ -52,9 +52,9 @@
       }
     },
     "node_modules/@apidevtools/json-schema-ref-parser": {
-      "version": "11.6.4",
-      "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.6.4.tgz",
-      "integrity": "sha512-9K6xOqeevacvweLGik6LnZCb1fBtCOSIWQs8d096XGeqoLKC33UVMGz9+77Gw44KvbH4pKcQPWo4ZpxkXYj05w==",
+      "version": "11.7.0",
+      "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.7.0.tgz",
+      "integrity": "sha512-pRrmXMCwnmrkS3MLgAIW5dXRzeTv6GLjkjb4HmxNnvAKXN1Nfzp4KmGADBQvlVUcqi+a5D+hfGDLLnd5NnYxog==",
       "license": "MIT",
       "dependencies": {
         "@jsdevtools/ono": "^7.1.3",
@@ -1311,13 +1311,13 @@
       }
     },
     "node_modules/ajv": {
-      "version": "8.15.0",
-      "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.15.0.tgz",
-      "integrity": "sha512-15BTtQUOsSrmHCy+B4VnAiJAJxJ8IFgu6fcjFQF3jQYZ78nLSQthlFg4ehp+NLIyfvFgOlxNsjKIEhydtFPVHQ==",
+      "version": "8.17.1",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz",
+      "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==",
       "license": "MIT",
       "dependencies": {
         "fast-deep-equal": "^3.1.3",
-        "fast-uri": "^2.3.0",
+        "fast-uri": "^3.0.1",
         "json-schema-traverse": "^1.0.0",
         "require-from-string": "^2.0.2"
       },
@@ -2655,9 +2655,9 @@
       "dev": true
     },
     "node_modules/fast-uri": {
-      "version": "2.4.0",
-      "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-2.4.0.tgz",
-      "integrity": "sha512-ypuAmmMKInk5q7XcepxlnUWDLWv4GFtaJqAzWKqn62IpQ3pejtr5dTVbt3vwqVaMKmkNR55sTT+CqUKIaT21BA==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz",
+      "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==",
       "license": "MIT"
     },
     "node_modules/figures": {
diff --git a/package.json b/package.json
index 6a4e94b..239e933 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "express-openapi-validator",
-  "version": "5.3.1",
+  "version": "5.3.2",
   "description": "Automatically validate API requests and responses with OpenAPI 3 and Express.",
   "main": "dist/index.js",
   "scripts": {
@@ -33,9 +33,9 @@
   "author": "Carmine DiMascio <cdimascio@gmail.com>",
   "license": "MIT",
   "dependencies": {
-    "@apidevtools/json-schema-ref-parser": "^11.6.4",
+    "@apidevtools/json-schema-ref-parser": "^11.7.0",
     "@types/multer": "^1.4.11",
-    "ajv": "^8.15.0",
+    "ajv": "^8.17.1",
     "ajv-draft-04": "^1.0.0",
     "ajv-formats": "^2.1.1",
     "content-type": "^1.0.5",
diff --git a/src/middlewares/openapi.security.ts b/src/middlewares/openapi.security.ts
index b3dbfe9..8f43af1 100644
--- a/src/middlewares/openapi.security.ts
+++ b/src/middlewares/openapi.security.ts
@@ -1,11 +1,11 @@
 import {
-  OpenAPIV3,
+  HttpError,
+  InternalServerError,
   OpenApiRequest,
-  SecurityHandlers,
-  OpenApiRequestMetadata,
   OpenApiRequestHandler,
-  InternalServerError,
-  HttpError,
+  OpenApiRequestMetadata,
+  OpenAPIV3,
+  SecurityHandlers,
 } from '../framework/types';
 
 const defaultSecurityHandler = (
@@ -17,11 +17,30 @@ const defaultSecurityHandler = (
 type SecuritySchemesMap = {
   [key: string]: OpenAPIV3.ReferenceObject | OpenAPIV3.SecuritySchemeObject;
 };
+
 interface SecurityHandlerResult {
   success: boolean;
   status?: number;
   error?: string;
 }
+
+function extractErrorsFromResults(results: (SecurityHandlerResult | SecurityHandlerResult[])[]) {
+  return results.map(result => {
+    if (Array.isArray(result)) {
+      return result.map(it => it).filter(it => !it.success);
+    }
+    return [result].filter(it => !it.success);
+  }).flatMap(it => [...it]);
+}
+
+function didAllSecurityRequirementsPass(results: SecurityHandlerResult[]) {
+  return results.every(it => it.success);
+}
+
+function didOneSchemaPassValidation(results: (SecurityHandlerResult | SecurityHandlerResult[])[]) {
+  return results.some(result => Array.isArray(result) ? didAllSecurityRequirementsPass(result) : result.success);
+}
+
 export function security(
   apiDoc: OpenAPIV3.Document,
   securityHandlers: SecurityHandlers,
@@ -62,50 +81,13 @@ export function security(
 
       // TODO handle AND'd and OR'd security
       // This assumes OR only! i.e. at least one security passed authentication
-      let firstError: SecurityHandlerResult = null;
-      let success = false;
-
-      function checkErrorWithOr(res) {
-        return res.forEach((r) => {
-          if (r.success) {
-            success = true;
-          } else if (!firstError) {
-            firstError = r;
-          }
-        });
-      }
-
-      function checkErrorsWithAnd(res) {
-        let allSuccess = false;
-
-        res.forEach((r) => {
-          if (!r.success) {
-            allSuccess = false;
-            if (!firstError) {
-              firstError = r;
-            }
-          } else if (!firstError) {
-            allSuccess = true;
-          }
-        });
-
-        if (allSuccess) {
-          success = true;
-        }
-      }
-
-      results.forEach((result) => {
-        if (Array.isArray(result) && result.length > 1) {
-          checkErrorsWithAnd(result);
-        } else {
-          checkErrorWithOr(result);
-        }
-      });
+      const success = didOneSchemaPassValidation(results);
 
       if (success) {
         next();
       } else {
-        throw firstError;
+        const errors = extractErrorsFromResults(results)
+        throw errors[0]
       }
     } catch (e) {
       const message = e?.error?.message || 'unauthorized';
@@ -129,6 +111,7 @@ class SecuritySchemes {
   private securitySchemes: SecuritySchemesMap;
   private securityHandlers: SecurityHandlers;
   private securities: OpenAPIV3.SecurityRequirementObject[];
+
   constructor(
     securitySchemes: SecuritySchemesMap,
     securityHandlers: SecurityHandlers,
@@ -213,6 +196,7 @@ class AuthValidator {
   private scheme;
   private path: string;
   private scopes: string[];
+
   constructor(req: OpenApiRequest, scheme, scopes: string[] = []) {
     const openapi = <OpenApiRequestMetadata>req.openapi;
     this.req = req;


Test patch:
diff --git a/test/resources/security.yaml b/test/resources/security.yaml
index 6ae8de5..3e6d2c6 100644
--- a/test/resources/security.yaml
+++ b/test/resources/security.yaml
@@ -90,6 +90,19 @@ paths:
         "401":
           description: unauthorized
 
+  /multi_auth:
+    get:
+      security:
+        - ApiKeyAuth: []
+          BearerAuth: []
+        - BasicAuth: []
+          CookieAuth: []
+      responses:
+        "200":
+          description: OK
+        "401":
+          description: unauthorized
+
   /oauth2:
     get:
       security:
diff --git a/test/security.defaults.spec.ts b/test/security.defaults.spec.ts
index 58b5e42..18bbeee 100644
--- a/test/security.defaults.spec.ts
+++ b/test/security.defaults.spec.ts
@@ -21,7 +21,8 @@ describe('security.defaults', () => {
         .get(`/cookie_auth`, (req, res) => res.json({ logged_in: true }))
         .get(`/bearer`, (req, res) => res.json({ logged_in: true }))
         .get(`/basic`, (req, res) => res.json({ logged_in: true }))
-        .get('/no_security', (req, res) => res.json({ logged_in: true })),
+        .get('/no_security', (req, res) => res.json({ logged_in: true }))
+        .get('/multi_auth', (req, res) => res.json({ logged_in: true }))
     );
   });
 
@@ -64,4 +65,33 @@ describe('security.defaults', () => {
           .that.equals('cookie \'JSESSIONID\' required');
       });
   });
+
+  it("Should return 200 WHEN one of multiple security rules is met GIVEN a request with apiKey and bearer token", () => {
+    return request(app)
+      .get(`${basePath}/multi_auth`)
+      .set({
+        "Authorization": "Bearer rawww",
+        "X-API-Key": "hello world"
+      })
+      .expect(200)
+  })
+
+  it("Should return 200 WHEN one of multiple security rules is met GIVEN a request with cookie and basic auth", () => {
+    return request(app)
+      .get(`${basePath}/multi_auth`)
+      .set({
+        "Authorization": "Basic ZGVtbzpwQDU1dzByZA==",
+        "Cookie": "JSESSIONID=dwdwdwdwd"
+      })
+      .expect(200)
+  })
+
+  it("Should return 401 WHEN none of multiple security rules is met GIVEN a request with only cookie auth", () => {
+    return request(app)
+      .get(`${basePath}/multi_auth`)
+      .set({
+        "Cookie": "JSESSIONID=dwdwdwdwd"
+      })
+      .expect(401)
+  })
 });