From 33c034068db5371cda5b94165f2e62265187d739 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 15 Oct 2024 17:14:53 +0200 Subject: [PATCH 01/12] Update schema-tests.yaml --- .github/workflows/schema-tests.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index b0f67019d7..73386e1e48 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -4,8 +4,11 @@ name: schema-test # Issue: https://github.com/OAI/OpenAPI-Specification/pull/2489 # -# This workflow runs the npm test script to validate passing and failing -# testcases for the metaschema. +# This workflow +# - converts the YAML metaschemas to JSON +# - runs the npm test script to validate passing and failing +# testcases for the metaschemas +# - checks in changed JSON files # # run this on push to any branch and creation of pull-requests @@ -23,13 +26,19 @@ jobs: - uses: actions/checkout@v4 # checkout repo content with: fetch-depth: 0 + - uses: actions/setup-node@v4 # setup Node.js with: node-version: '20.x' + - name: Install dependencies from main run: | git checkout remotes/origin/main -- package.json package-lock.json npm ci + + - name: convert YAML metaschemas to JSON + run: find schemas/v3* -type f -name "*.yaml" | xargs node scripts/yaml2json/yaml2json.js + - name: Run tests run: npm run test From 7532592d7fc9a56087c3cd82127fcb0e1d9f7496 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 15 Oct 2024 17:22:05 +0200 Subject: [PATCH 02/12] Add check-in step --- .github/workflows/schema-tests.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index 73386e1e48..edf168e838 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -42,3 +42,13 @@ jobs: - name: Run tests run: npm run test + - name: Check in changed JSON files + run: | + git config user.name ${GITHUB_ACTOR} + git config user.email ${PUSHER_EMAIL} + git add schemas/**/*.json + git diff-index --quiet HEAD schemas/**/*.json || git commit -m "converted JSON metaschemas" + git push + env: + CI: true + PUSHER_EMAIL: ${{ github.event.pusher.email }} From 42f7075cf1854d44c99b6434a0e897538c6a2288 Mon Sep 17 00:00:00 2001 From: ralfhandl Date: Tue, 15 Oct 2024 15:22:34 +0000 Subject: [PATCH 03/12] converted JSON metaschemas --- package-lock.json | 130 +++++++------- package.json | 4 +- schemas/v3.0/schema.json | 313 ++++++++++++++++------------------ schemas/v3.1/schema-base.json | 18 +- schemas/v3.1/schema.json | 35 ++-- 5 files changed, 245 insertions(+), 255 deletions(-) diff --git a/package-lock.json b/package-lock.json index 301f7b23db..75b58b2d24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,8 @@ "c8": "^10.1.2", "markdownlint-cli": "^0.42.0", "mdv": "^1.3.4", - "vitest": "^2.1.3", - "yaml": "^2.6.0" + "vitest": "^2.1.2", + "yaml": "^2.5.1" } }, "node_modules/@babel/code-frame": { @@ -867,13 +867,13 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.3.tgz", - "integrity": "sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.2.tgz", + "integrity": "sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==", "dev": true, "dependencies": { - "@vitest/spy": "2.1.3", - "@vitest/utils": "2.1.3", + "@vitest/spy": "2.1.2", + "@vitest/utils": "2.1.2", "chai": "^5.1.1", "tinyrainbow": "^1.2.0" }, @@ -882,12 +882,12 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.3.tgz", - "integrity": "sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.2.tgz", + "integrity": "sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==", "dev": true, "dependencies": { - "@vitest/spy": "2.1.3", + "@vitest/spy": "^2.1.0-beta.1", "estree-walker": "^3.0.3", "magic-string": "^0.30.11" }, @@ -895,7 +895,7 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/spy": "2.1.3", + "@vitest/spy": "2.1.2", "msw": "^2.3.5", "vite": "^5.0.0" }, @@ -909,9 +909,9 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.3.tgz", - "integrity": "sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.2.tgz", + "integrity": "sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==", "dev": true, "dependencies": { "tinyrainbow": "^1.2.0" @@ -921,12 +921,12 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.3.tgz", - "integrity": "sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.2.tgz", + "integrity": "sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==", "dev": true, "dependencies": { - "@vitest/utils": "2.1.3", + "@vitest/utils": "2.1.2", "pathe": "^1.1.2" }, "funding": { @@ -934,12 +934,12 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.3.tgz", - "integrity": "sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.2.tgz", + "integrity": "sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.3", + "@vitest/pretty-format": "2.1.2", "magic-string": "^0.30.11", "pathe": "^1.1.2" }, @@ -948,9 +948,9 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.3.tgz", - "integrity": "sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.2.tgz", + "integrity": "sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==", "dev": true, "dependencies": { "tinyspy": "^3.0.0" @@ -960,12 +960,12 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.3.tgz", - "integrity": "sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.2.tgz", + "integrity": "sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==", "dev": true, "dependencies": { - "@vitest/pretty-format": "2.1.3", + "@vitest/pretty-format": "2.1.2", "loupe": "^3.1.1", "tinyrainbow": "^1.2.0" }, @@ -2101,6 +2101,15 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/get-stdin": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", @@ -2651,10 +2660,13 @@ "license": "MIT" }, "node_modules/loupe": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", - "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", + "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.1" + } }, "node_modules/lru-cache": { "version": "10.4.3", @@ -2664,9 +2676,9 @@ "license": "ISC" }, "node_modules/magic-string": { - "version": "0.30.12", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", - "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", + "version": "0.30.11", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", + "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" @@ -4222,9 +4234,9 @@ } }, "node_modules/vite": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", - "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "dependencies": { "esbuild": "^0.21.3", @@ -4281,9 +4293,9 @@ } }, "node_modules/vite-node": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.3.tgz", - "integrity": "sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.2.tgz", + "integrity": "sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==", "dev": true, "dependencies": { "cac": "^6.7.14", @@ -4325,18 +4337,18 @@ "dev": true }, "node_modules/vitest": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.3.tgz", - "integrity": "sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.2.tgz", + "integrity": "sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==", "dev": true, "dependencies": { - "@vitest/expect": "2.1.3", - "@vitest/mocker": "2.1.3", - "@vitest/pretty-format": "^2.1.3", - "@vitest/runner": "2.1.3", - "@vitest/snapshot": "2.1.3", - "@vitest/spy": "2.1.3", - "@vitest/utils": "2.1.3", + "@vitest/expect": "2.1.2", + "@vitest/mocker": "2.1.2", + "@vitest/pretty-format": "^2.1.2", + "@vitest/runner": "2.1.2", + "@vitest/snapshot": "2.1.2", + "@vitest/spy": "2.1.2", + "@vitest/utils": "2.1.2", "chai": "^5.1.1", "debug": "^4.3.6", "magic-string": "^0.30.11", @@ -4347,7 +4359,7 @@ "tinypool": "^1.0.0", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.3", + "vite-node": "2.1.2", "why-is-node-running": "^2.3.0" }, "bin": { @@ -4362,8 +4374,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.3", - "@vitest/ui": "2.1.3", + "@vitest/browser": "2.1.2", + "@vitest/ui": "2.1.2", "happy-dom": "*", "jsdom": "*" }, @@ -4634,9 +4646,9 @@ } }, "node_modules/yaml": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", - "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", "dev": true, "bin": { "yaml": "bin.mjs" diff --git a/package.json b/package.json index 8b4e5c6123..abdb7dce9c 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "c8": "^10.1.2", "markdownlint-cli": "^0.42.0", "mdv": "^1.3.4", - "vitest": "^2.1.3", - "yaml": "^2.6.0" + "vitest": "^2.1.2", + "yaml": "^2.5.1" }, "keywords": [ "OpenAPI", diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json index 6a175a4f63..2f0400737c 100644 --- a/schemas/v3.0/schema.json +++ b/schemas/v3.0/schema.json @@ -46,8 +46,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "definitions": { @@ -91,8 +90,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -112,8 +110,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -132,8 +129,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -157,8 +153,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -182,8 +177,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -327,8 +321,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -402,8 +395,7 @@ }, "enum": { "type": "array", - "items": { - }, + "items": {}, "minItems": 1, "uniqueItems": false }, @@ -510,8 +502,7 @@ "format": { "type": "string" }, - "default": { - }, + "default": {}, "nullable": { "type": "boolean", "default": false @@ -527,8 +518,7 @@ "type": "boolean", "default": false }, - "example": { - }, + "example": {}, "externalDocs": { "$ref": "#/definitions/ExternalDocumentation" }, @@ -541,8 +531,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -586,8 +575,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -634,8 +622,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -652,8 +639,7 @@ } ] }, - "example": { - }, + "example": {}, "examples": { "type": "object", "additionalProperties": { @@ -675,8 +661,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "allOf": [ @@ -694,16 +679,14 @@ "description": { "type": "string" }, - "value": { - }, + "value": {}, "externalValue": { "type": "string", "format": "uri-reference" } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -757,8 +740,7 @@ "minProperties": 1, "maxProperties": 1 }, - "example": { - }, + "example": {}, "examples": { "type": "object", "additionalProperties": { @@ -774,8 +756,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "allOf": [ @@ -793,8 +774,7 @@ "^\\/": { "$ref": "#/definitions/PathItem" }, - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -810,6 +790,30 @@ "description": { "type": "string" }, + "get": { + "$ref": "#/definitions/Operation" + }, + "put": { + "$ref": "#/definitions/Operation" + }, + "post": { + "$ref": "#/definitions/Operation" + }, + "delete": { + "$ref": "#/definitions/Operation" + }, + "options": { + "$ref": "#/definitions/Operation" + }, + "head": { + "$ref": "#/definitions/Operation" + }, + "patch": { + "$ref": "#/definitions/Operation" + }, + "trace": { + "$ref": "#/definitions/Operation" + }, "servers": { "type": "array", "items": { @@ -832,11 +836,7 @@ } }, "patternProperties": { - "^(get|put|post|delete|options|head|patch|trace)$": { - "$ref": "#/definitions/Operation" - }, - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -922,8 +922,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -952,8 +951,7 @@ } ] }, - "^x-": { - } + "^x-": {} }, "minProperties": 1, "additionalProperties": false @@ -984,8 +982,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1004,8 +1001,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1129,8 +1125,7 @@ "minProperties": 1, "maxProperties": 1 }, - "example": { - }, + "example": {}, "examples": { "type": "object", "additionalProperties": { @@ -1146,8 +1141,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "required": [ @@ -1160,94 +1154,100 @@ }, { "$ref": "#/definitions/SchemaXORContent" - }, - { - "$ref": "#/definitions/ParameterLocation" } - ] - }, - "ParameterLocation": { - "description": "Parameter location", + ], "oneOf": [ { - "description": "Parameter in path", - "required": [ - "required" - ], - "properties": { - "in": { - "enum": [ - "path" - ] - }, - "style": { - "enum": [ - "matrix", - "label", - "simple" - ], - "default": "simple" - }, - "required": { - "enum": [ - true - ] - } - } + "$ref": "#/definitions/PathParameter" }, { - "description": "Parameter in query", - "properties": { - "in": { - "enum": [ - "query" - ] - }, - "style": { - "enum": [ - "form", - "spaceDelimited", - "pipeDelimited", - "deepObject" - ], - "default": "form" - } - } + "$ref": "#/definitions/QueryParameter" }, { - "description": "Parameter in header", - "properties": { - "in": { - "enum": [ - "header" - ] - }, - "style": { - "enum": [ - "simple" - ], - "default": "simple" - } - } + "$ref": "#/definitions/HeaderParameter" }, { - "description": "Parameter in cookie", - "properties": { - "in": { - "enum": [ - "cookie" - ] - }, - "style": { - "enum": [ - "form" - ], - "default": "form" - } - } + "$ref": "#/definitions/CookieParameter" } ] }, + "PathParameter": { + "description": "Parameter in path", + "required": [ + "required" + ], + "properties": { + "in": { + "enum": [ + "path" + ] + }, + "style": { + "enum": [ + "matrix", + "label", + "simple" + ], + "default": "simple" + }, + "required": { + "enum": [ + true + ] + } + } + }, + "QueryParameter": { + "description": "Parameter in query", + "properties": { + "in": { + "enum": [ + "query" + ] + }, + "style": { + "enum": [ + "form", + "spaceDelimited", + "pipeDelimited", + "deepObject" + ], + "default": "form" + } + } + }, + "HeaderParameter": { + "description": "Parameter in header", + "properties": { + "in": { + "enum": [ + "header" + ] + }, + "style": { + "enum": [ + "simple" + ], + "default": "simple" + } + } + }, + "CookieParameter": { + "description": "Parameter in cookie", + "properties": { + "in": { + "enum": [ + "cookie" + ] + }, + "style": { + "enum": [ + "form" + ], + "default": "form" + } + } + }, "RequestBody": { "type": "object", "required": [ @@ -1269,8 +1269,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1320,8 +1319,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1349,8 +1347,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "oneOf": [ @@ -1402,8 +1399,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1429,8 +1425,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1451,8 +1446,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1479,8 +1473,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1507,8 +1500,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1535,8 +1527,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1568,8 +1559,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false }, @@ -1585,11 +1575,9 @@ }, "parameters": { "type": "object", - "additionalProperties": { - } - }, - "requestBody": { + "additionalProperties": {} }, + "requestBody": {}, "description": { "type": "string" }, @@ -1598,8 +1586,7 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false, "not": { @@ -1616,8 +1603,7 @@ "$ref": "#/definitions/PathItem" }, "patternProperties": { - "^x-": { - } + "^x-": {} } }, "Encoding": { @@ -1657,10 +1643,9 @@ } }, "patternProperties": { - "^x-": { - } + "^x-": {} }, "additionalProperties": false } } -} +} \ No newline at end of file diff --git a/schemas/v3.1/schema-base.json b/schemas/v3.1/schema-base.json index 752e98be4e..b48dbac104 100644 --- a/schemas/v3.1/schema-base.json +++ b/schemas/v3.1/schema-base.json @@ -1,23 +1,25 @@ { "$id": "https://spec.openapis.org/oas/3.1/schema-base/2022-10-07", "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0", - "$ref": "https://spec.openapis.org/oas/3.1/schema/2022-10-07", "properties": { - "jsonSchemaDialect": { "$ref": "#/$defs/dialect" } + "jsonSchemaDialect": { + "$ref": "#/$defs/dialect" + } }, - "$defs": { - "dialect": { "const": "https://spec.openapis.org/oas/3.1/dialect/base" }, - + "dialect": { + "const": "https://spec.openapis.org/oas/3.1/dialect/base" + }, "schema": { "$dynamicAnchor": "meta", "$ref": "https://spec.openapis.org/oas/3.1/dialect/base", "properties": { - "$schema": { "$ref": "#/$defs/dialect" } + "$schema": { + "$ref": "#/$defs/dialect" + } } } } -} +} \ No newline at end of file diff --git a/schemas/v3.1/schema.json b/schemas/v3.1/schema.json index 778b2edfa8..0fa9d5b3ad 100644 --- a/schemas/v3.1/schema.json +++ b/schemas/v3.1/schema.json @@ -33,7 +33,7 @@ "webhooks": { "type": "object", "additionalProperties": { - "$ref": "#/$defs/path-item-or-reference" + "$ref": "#/$defs/path-item" } }, "components": { @@ -167,8 +167,7 @@ "type": "object", "properties": { "url": { - "type": "string", - "format": "uri-reference" + "type": "string" }, "description": { "type": "string" @@ -271,7 +270,7 @@ "pathItems": { "type": "object", "additionalProperties": { - "$ref": "#/$defs/path-item-or-reference" + "$ref": "#/$defs/path-item" } } }, @@ -301,6 +300,10 @@ "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object", "type": "object", "properties": { + "$ref": { + "type": "string", + "format": "uri-reference" + }, "summary": { "type": "string" }, @@ -347,20 +350,6 @@ "$ref": "#/$defs/specification-extensions", "unevaluatedProperties": false }, - "path-item-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/path-item" - } - }, "operation": { "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object", "type": "object", @@ -790,8 +779,10 @@ "^[1-5](?:[0-9]{2}|XX)$": false } }, - "then" : { - "required": [ "default" ] + "then": { + "required": [ + "default" + ] } }, "response": { @@ -842,7 +833,7 @@ "type": "object", "$ref": "#/$defs/specification-extensions", "additionalProperties": { - "$ref": "#/$defs/path-item-or-reference" + "$ref": "#/$defs/path-item" } }, "callbacks-or-reference": { @@ -1414,4 +1405,4 @@ } } } -} +} \ No newline at end of file From 7119547558e663eaa7c83359b3f894a87b5c941b Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 15 Oct 2024 17:27:05 +0200 Subject: [PATCH 04/12] Update comment --- .github/workflows/schema-tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index edf168e838..da0cda383d 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -6,8 +6,7 @@ name: schema-test # # This workflow # - converts the YAML metaschemas to JSON -# - runs the npm test script to validate passing and failing -# testcases for the metaschemas +# - runs the npm test script to validate passing and failing testcases for the metaschemas # - checks in changed JSON files # From 50047b662acb7464974bb869a8d710c06e9c4e64 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Tue, 15 Oct 2024 17:39:14 +0200 Subject: [PATCH 05/12] Update schema-tests.yaml --- .github/workflows/schema-tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index da0cda383d..6732e3e7c2 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -13,7 +13,6 @@ name: schema-test # run this on push to any branch and creation of pull-requests on: push: {} - pull_request: {} workflow_dispatch: {} jobs: From 882d1caedb0bff825a1fd10728e7e3dc43912d37 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 09:43:06 +0200 Subject: [PATCH 06/12] Only generate JSON before running the tests --- .github/workflows/schema-tests.yaml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index 6732e3e7c2..ce4a7f151d 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -7,12 +7,12 @@ name: schema-test # This workflow # - converts the YAML metaschemas to JSON # - runs the npm test script to validate passing and failing testcases for the metaschemas -# - checks in changed JSON files # # run this on push to any branch and creation of pull-requests on: push: {} + pull_request: {} workflow_dispatch: {} jobs: @@ -39,14 +39,3 @@ jobs: - name: Run tests run: npm run test - - - name: Check in changed JSON files - run: | - git config user.name ${GITHUB_ACTOR} - git config user.email ${PUSHER_EMAIL} - git add schemas/**/*.json - git diff-index --quiet HEAD schemas/**/*.json || git commit -m "converted JSON metaschemas" - git push - env: - CI: true - PUSHER_EMAIL: ${{ github.event.pusher.email }} From c993d0682c2fb4aad37ce91c625f118098e1a0e1 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 10:00:07 +0200 Subject: [PATCH 07/12] Use YAML for schema tests and don't convert to JSON --- .github/workflows/schema-tests.yaml | 8 +- schemas/v3.0/schema.json | 1651 ------------------------- schemas/v3.1/dialect/base.schema.json | 25 - schemas/v3.1/meta/base.schema.json | 87 -- schemas/v3.1/schema-base.json | 25 - schemas/v3.1/schema.json | 1408 --------------------- tests/v3.0/examples.test.js | 17 +- tests/v3.1/examples.test.js | 17 +- tests/v3.1/schema.test.mjs | 17 +- 9 files changed, 50 insertions(+), 3205 deletions(-) delete mode 100644 schemas/v3.0/schema.json delete mode 100644 schemas/v3.1/dialect/base.schema.json delete mode 100644 schemas/v3.1/meta/base.schema.json delete mode 100644 schemas/v3.1/schema-base.json delete mode 100644 schemas/v3.1/schema.json diff --git a/.github/workflows/schema-tests.yaml b/.github/workflows/schema-tests.yaml index ce4a7f151d..875622a2c4 100644 --- a/.github/workflows/schema-tests.yaml +++ b/.github/workflows/schema-tests.yaml @@ -4,9 +4,8 @@ name: schema-test # Issue: https://github.com/OAI/OpenAPI-Specification/pull/2489 # -# This workflow -# - converts the YAML metaschemas to JSON -# - runs the npm test script to validate passing and failing testcases for the metaschemas +# This workflow runs the npm test script to validate passing and failing +# testcases for the metaschemas # # run this on push to any branch and creation of pull-requests @@ -34,8 +33,5 @@ jobs: git checkout remotes/origin/main -- package.json package-lock.json npm ci - - name: convert YAML metaschemas to JSON - run: find schemas/v3* -type f -name "*.yaml" | xargs node scripts/yaml2json/yaml2json.js - - name: Run tests run: npm run test diff --git a/schemas/v3.0/schema.json b/schemas/v3.0/schema.json deleted file mode 100644 index 2f0400737c..0000000000 --- a/schemas/v3.0/schema.json +++ /dev/null @@ -1,1651 +0,0 @@ -{ - "id": "https://spec.openapis.org/oas/3.0/schema/2021-09-28", - "$schema": "http://json-schema.org/draft-04/schema#", - "description": "The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3", - "type": "object", - "required": [ - "openapi", - "info", - "paths" - ], - "properties": { - "openapi": { - "type": "string", - "pattern": "^3\\.0\\.\\d(-.+)?$" - }, - "info": { - "$ref": "#/definitions/Info" - }, - "externalDocs": { - "$ref": "#/definitions/ExternalDocumentation" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/definitions/Server" - } - }, - "security": { - "type": "array", - "items": { - "$ref": "#/definitions/SecurityRequirement" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/definitions/Tag" - }, - "uniqueItems": true - }, - "paths": { - "$ref": "#/definitions/Paths" - }, - "components": { - "$ref": "#/definitions/Components" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "definitions": { - "Reference": { - "type": "object", - "required": [ - "$ref" - ], - "patternProperties": { - "^\\$ref$": { - "type": "string", - "format": "uri-reference" - } - } - }, - "Info": { - "type": "object", - "required": [ - "title", - "version" - ], - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "termsOfService": { - "type": "string", - "format": "uri-reference" - }, - "contact": { - "$ref": "#/definitions/Contact" - }, - "license": { - "$ref": "#/definitions/License" - }, - "version": { - "type": "string" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Contact": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri-reference" - }, - "email": { - "type": "string", - "format": "email" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "License": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri-reference" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Server": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "url": { - "type": "string" - }, - "description": { - "type": "string" - }, - "variables": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/ServerVariable" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "ServerVariable": { - "type": "object", - "required": [ - "default" - ], - "properties": { - "enum": { - "type": "array", - "items": { - "type": "string" - } - }, - "default": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Components": { - "type": "object", - "properties": { - "schemas": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - } - }, - "responses": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Response" - } - ] - } - } - }, - "parameters": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Parameter" - } - ] - } - } - }, - "examples": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Example" - } - ] - } - } - }, - "requestBodies": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/RequestBody" - } - ] - } - } - }, - "headers": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Header" - } - ] - } - } - }, - "securitySchemes": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/SecurityScheme" - } - ] - } - } - }, - "links": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Link" - } - ] - } - } - }, - "callbacks": { - "type": "object", - "patternProperties": { - "^[a-zA-Z0-9\\.\\-_]+$": { - "oneOf": [ - { - "$ref": "#/definitions/Reference" - }, - { - "$ref": "#/definitions/Callback" - } - ] - } - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Schema": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "multipleOf": { - "type": "number", - "minimum": 0, - "exclusiveMinimum": true - }, - "maximum": { - "type": "number" - }, - "exclusiveMaximum": { - "type": "boolean", - "default": false - }, - "minimum": { - "type": "number" - }, - "exclusiveMinimum": { - "type": "boolean", - "default": false - }, - "maxLength": { - "type": "integer", - "minimum": 0 - }, - "minLength": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "pattern": { - "type": "string", - "format": "regex" - }, - "maxItems": { - "type": "integer", - "minimum": 0 - }, - "minItems": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "uniqueItems": { - "type": "boolean", - "default": false - }, - "maxProperties": { - "type": "integer", - "minimum": 0 - }, - "minProperties": { - "type": "integer", - "minimum": 0, - "default": 0 - }, - "required": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1, - "uniqueItems": true - }, - "enum": { - "type": "array", - "items": {}, - "minItems": 1, - "uniqueItems": false - }, - "type": { - "type": "string", - "enum": [ - "array", - "boolean", - "integer", - "number", - "object", - "string" - ] - }, - "not": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "allOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "oneOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "anyOf": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "properties": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - }, - { - "type": "boolean" - } - ], - "default": true - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - }, - "default": {}, - "nullable": { - "type": "boolean", - "default": false - }, - "discriminator": { - "$ref": "#/definitions/Discriminator" - }, - "readOnly": { - "type": "boolean", - "default": false - }, - "writeOnly": { - "type": "boolean", - "default": false - }, - "example": {}, - "externalDocs": { - "$ref": "#/definitions/ExternalDocumentation" - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "xml": { - "$ref": "#/definitions/XML" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Discriminator": { - "type": "object", - "required": [ - "propertyName" - ], - "properties": { - "propertyName": { - "type": "string" - }, - "mapping": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "XML": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string", - "format": "uri" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean", - "default": false - }, - "wrapped": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Response": { - "type": "object", - "required": [ - "description" - ], - "properties": { - "description": { - "type": "string" - }, - "headers": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Header" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "content": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/MediaType" - } - }, - "links": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Link" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "MediaType": { - "type": "object", - "properties": { - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "example": {}, - "examples": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Example" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "encoding": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/Encoding" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "allOf": [ - { - "$ref": "#/definitions/ExampleXORExamples" - } - ] - }, - "Example": { - "type": "object", - "properties": { - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "value": {}, - "externalValue": { - "type": "string", - "format": "uri-reference" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Header": { - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "required": { - "type": "boolean", - "default": false - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "allowEmptyValue": { - "type": "boolean", - "default": false - }, - "style": { - "type": "string", - "enum": [ - "simple" - ], - "default": "simple" - }, - "explode": { - "type": "boolean" - }, - "allowReserved": { - "type": "boolean", - "default": false - }, - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "content": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/MediaType" - }, - "minProperties": 1, - "maxProperties": 1 - }, - "example": {}, - "examples": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Example" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "allOf": [ - { - "$ref": "#/definitions/ExampleXORExamples" - }, - { - "$ref": "#/definitions/SchemaXORContent" - } - ] - }, - "Paths": { - "type": "object", - "patternProperties": { - "^\\/": { - "$ref": "#/definitions/PathItem" - }, - "^x-": {} - }, - "additionalProperties": false - }, - "PathItem": { - "type": "object", - "properties": { - "$ref": { - "type": "string" - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "get": { - "$ref": "#/definitions/Operation" - }, - "put": { - "$ref": "#/definitions/Operation" - }, - "post": { - "$ref": "#/definitions/Operation" - }, - "delete": { - "$ref": "#/definitions/Operation" - }, - "options": { - "$ref": "#/definitions/Operation" - }, - "head": { - "$ref": "#/definitions/Operation" - }, - "patch": { - "$ref": "#/definitions/Operation" - }, - "trace": { - "$ref": "#/definitions/Operation" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/definitions/Server" - } - }, - "parameters": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Parameter" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "uniqueItems": true - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Operation": { - "type": "object", - "required": [ - "responses" - ], - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/definitions/ExternalDocumentation" - }, - "operationId": { - "type": "string" - }, - "parameters": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/definitions/Parameter" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "uniqueItems": true - }, - "requestBody": { - "oneOf": [ - { - "$ref": "#/definitions/RequestBody" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "responses": { - "$ref": "#/definitions/Responses" - }, - "callbacks": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Callback" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "security": { - "type": "array", - "items": { - "$ref": "#/definitions/SecurityRequirement" - } - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/definitions/Server" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Responses": { - "type": "object", - "properties": { - "default": { - "oneOf": [ - { - "$ref": "#/definitions/Response" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "patternProperties": { - "^[1-5](?:\\d{2}|XX)$": { - "oneOf": [ - { - "$ref": "#/definitions/Response" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "^x-": {} - }, - "minProperties": 1, - "additionalProperties": false - }, - "SecurityRequirement": { - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "Tag": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/definitions/ExternalDocumentation" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "ExternalDocumentation": { - "type": "object", - "required": [ - "url" - ], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri-reference" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "ExampleXORExamples": { - "description": "Example and examples are mutually exclusive", - "not": { - "required": [ - "example", - "examples" - ] - } - }, - "SchemaXORContent": { - "description": "Schema and content are mutually exclusive, at least one is required", - "not": { - "required": [ - "schema", - "content" - ] - }, - "oneOf": [ - { - "required": [ - "schema" - ] - }, - { - "required": [ - "content" - ], - "description": "Some properties are not allowed if content is present", - "allOf": [ - { - "not": { - "required": [ - "style" - ] - } - }, - { - "not": { - "required": [ - "explode" - ] - } - }, - { - "not": { - "required": [ - "allowReserved" - ] - } - }, - { - "not": { - "required": [ - "example" - ] - } - }, - { - "not": { - "required": [ - "examples" - ] - } - } - ] - } - ] - }, - "Parameter": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "in": { - "type": "string" - }, - "description": { - "type": "string" - }, - "required": { - "type": "boolean", - "default": false - }, - "deprecated": { - "type": "boolean", - "default": false - }, - "allowEmptyValue": { - "type": "boolean", - "default": false - }, - "style": { - "type": "string" - }, - "explode": { - "type": "boolean" - }, - "allowReserved": { - "type": "boolean", - "default": false - }, - "schema": { - "oneOf": [ - { - "$ref": "#/definitions/Schema" - }, - { - "$ref": "#/definitions/Reference" - } - ] - }, - "content": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/MediaType" - }, - "minProperties": 1, - "maxProperties": 1 - }, - "example": {}, - "examples": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Example" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "required": [ - "name", - "in" - ], - "allOf": [ - { - "$ref": "#/definitions/ExampleXORExamples" - }, - { - "$ref": "#/definitions/SchemaXORContent" - } - ], - "oneOf": [ - { - "$ref": "#/definitions/PathParameter" - }, - { - "$ref": "#/definitions/QueryParameter" - }, - { - "$ref": "#/definitions/HeaderParameter" - }, - { - "$ref": "#/definitions/CookieParameter" - } - ] - }, - "PathParameter": { - "description": "Parameter in path", - "required": [ - "required" - ], - "properties": { - "in": { - "enum": [ - "path" - ] - }, - "style": { - "enum": [ - "matrix", - "label", - "simple" - ], - "default": "simple" - }, - "required": { - "enum": [ - true - ] - } - } - }, - "QueryParameter": { - "description": "Parameter in query", - "properties": { - "in": { - "enum": [ - "query" - ] - }, - "style": { - "enum": [ - "form", - "spaceDelimited", - "pipeDelimited", - "deepObject" - ], - "default": "form" - } - } - }, - "HeaderParameter": { - "description": "Parameter in header", - "properties": { - "in": { - "enum": [ - "header" - ] - }, - "style": { - "enum": [ - "simple" - ], - "default": "simple" - } - } - }, - "CookieParameter": { - "description": "Parameter in cookie", - "properties": { - "in": { - "enum": [ - "cookie" - ] - }, - "style": { - "enum": [ - "form" - ], - "default": "form" - } - } - }, - "RequestBody": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "description": { - "type": "string" - }, - "content": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/MediaType" - } - }, - "required": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "SecurityScheme": { - "oneOf": [ - { - "$ref": "#/definitions/APIKeySecurityScheme" - }, - { - "$ref": "#/definitions/HTTPSecurityScheme" - }, - { - "$ref": "#/definitions/OAuth2SecurityScheme" - }, - { - "$ref": "#/definitions/OpenIdConnectSecurityScheme" - } - ] - }, - "APIKeySecurityScheme": { - "type": "object", - "required": [ - "type", - "name", - "in" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "apiKey" - ] - }, - "name": { - "type": "string" - }, - "in": { - "type": "string", - "enum": [ - "header", - "query", - "cookie" - ] - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "HTTPSecurityScheme": { - "type": "object", - "required": [ - "scheme", - "type" - ], - "properties": { - "scheme": { - "type": "string" - }, - "bearerFormat": { - "type": "string" - }, - "description": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "http" - ] - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "oneOf": [ - { - "description": "Bearer", - "properties": { - "scheme": { - "type": "string", - "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" - } - } - }, - { - "description": "Non Bearer", - "not": { - "required": [ - "bearerFormat" - ] - }, - "properties": { - "scheme": { - "not": { - "type": "string", - "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" - } - } - } - } - ] - }, - "OAuth2SecurityScheme": { - "type": "object", - "required": [ - "type", - "flows" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "oauth2" - ] - }, - "flows": { - "$ref": "#/definitions/OAuthFlows" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "OpenIdConnectSecurityScheme": { - "type": "object", - "required": [ - "type", - "openIdConnectUrl" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "openIdConnect" - ] - }, - "openIdConnectUrl": { - "type": "string", - "format": "uri-reference" - }, - "description": { - "type": "string" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "OAuthFlows": { - "type": "object", - "properties": { - "implicit": { - "$ref": "#/definitions/ImplicitOAuthFlow" - }, - "password": { - "$ref": "#/definitions/PasswordOAuthFlow" - }, - "clientCredentials": { - "$ref": "#/definitions/ClientCredentialsFlow" - }, - "authorizationCode": { - "$ref": "#/definitions/AuthorizationCodeOAuthFlow" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "ImplicitOAuthFlow": { - "type": "object", - "required": [ - "authorizationUrl", - "scopes" - ], - "properties": { - "authorizationUrl": { - "type": "string", - "format": "uri-reference" - }, - "refreshUrl": { - "type": "string", - "format": "uri-reference" - }, - "scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "PasswordOAuthFlow": { - "type": "object", - "required": [ - "tokenUrl", - "scopes" - ], - "properties": { - "tokenUrl": { - "type": "string", - "format": "uri-reference" - }, - "refreshUrl": { - "type": "string", - "format": "uri-reference" - }, - "scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "ClientCredentialsFlow": { - "type": "object", - "required": [ - "tokenUrl", - "scopes" - ], - "properties": { - "tokenUrl": { - "type": "string", - "format": "uri-reference" - }, - "refreshUrl": { - "type": "string", - "format": "uri-reference" - }, - "scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "AuthorizationCodeOAuthFlow": { - "type": "object", - "required": [ - "authorizationUrl", - "tokenUrl", - "scopes" - ], - "properties": { - "authorizationUrl": { - "type": "string", - "format": "uri-reference" - }, - "tokenUrl": { - "type": "string", - "format": "uri-reference" - }, - "refreshUrl": { - "type": "string", - "format": "uri-reference" - }, - "scopes": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - }, - "Link": { - "type": "object", - "properties": { - "operationId": { - "type": "string" - }, - "operationRef": { - "type": "string", - "format": "uri-reference" - }, - "parameters": { - "type": "object", - "additionalProperties": {} - }, - "requestBody": {}, - "description": { - "type": "string" - }, - "server": { - "$ref": "#/definitions/Server" - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false, - "not": { - "description": "Operation Id and Operation Ref are mutually exclusive", - "required": [ - "operationId", - "operationRef" - ] - } - }, - "Callback": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/PathItem" - }, - "patternProperties": { - "^x-": {} - } - }, - "Encoding": { - "type": "object", - "properties": { - "contentType": { - "type": "string" - }, - "headers": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "$ref": "#/definitions/Header" - }, - { - "$ref": "#/definitions/Reference" - } - ] - } - }, - "style": { - "type": "string", - "enum": [ - "form", - "spaceDelimited", - "pipeDelimited", - "deepObject" - ] - }, - "explode": { - "type": "boolean" - }, - "allowReserved": { - "type": "boolean", - "default": false - } - }, - "patternProperties": { - "^x-": {} - }, - "additionalProperties": false - } - } -} \ No newline at end of file diff --git a/schemas/v3.1/dialect/base.schema.json b/schemas/v3.1/dialect/base.schema.json deleted file mode 100644 index eae8386e8a..0000000000 --- a/schemas/v3.1/dialect/base.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$id": "https://spec.openapis.org/oas/3.1/dialect/base", - "$schema": "https://json-schema.org/draft/2020-12/schema", - - "title": "OpenAPI 3.1 Schema Object Dialect", - "description": "A JSON Schema dialect describing schemas found in OpenAPI documents", - - "$vocabulary": { - "https://json-schema.org/draft/2020-12/vocab/core": true, - "https://json-schema.org/draft/2020-12/vocab/applicator": true, - "https://json-schema.org/draft/2020-12/vocab/unevaluated": true, - "https://json-schema.org/draft/2020-12/vocab/validation": true, - "https://json-schema.org/draft/2020-12/vocab/meta-data": true, - "https://json-schema.org/draft/2020-12/vocab/format-annotation": true, - "https://json-schema.org/draft/2020-12/vocab/content": true, - "https://spec.openapis.org/oas/3.1/vocab/base": false - }, - - "$dynamicAnchor": "meta", - - "allOf": [ - { "$ref": "https://json-schema.org/draft/2020-12/schema" }, - { "$ref": "https://spec.openapis.org/oas/3.1/meta/base" } - ] -} diff --git a/schemas/v3.1/meta/base.schema.json b/schemas/v3.1/meta/base.schema.json deleted file mode 100644 index a7a59f1c7d..0000000000 --- a/schemas/v3.1/meta/base.schema.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "$id": "https://spec.openapis.org/oas/3.1/meta/base", - "$schema": "https://json-schema.org/draft/2020-12/schema", - - "title": "OAS Base vocabulary", - "description": "A JSON Schema Vocabulary used in the OpenAPI Schema Dialect", - - "$vocabulary": { - "https://spec.openapis.org/oas/3.1/vocab/base": true - }, - - "$dynamicAnchor": "meta", - - "type": ["object", "boolean"], - "properties": { - "example": true, - "discriminator": { "$ref": "#/$defs/discriminator" }, - "externalDocs": { "$ref": "#/$defs/external-docs" }, - "xml": { "$ref": "#/$defs/xml" } - }, - - "$defs": { - "extensible": { - "patternProperties": { - "^x-": true - } - }, - - "discriminator": { - "$ref": "#/$defs/extensible", - "type": "object", - "properties": { - "propertyName": { - "type": "string" - }, - "mapping": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["propertyName"], - "unevaluatedProperties": false - }, - - "external-docs": { - "$ref": "#/$defs/extensible", - "type": "object", - "properties": { - "url": { - "type": "string", - "format": "uri-reference" - }, - "description": { - "type": "string" - } - }, - "required": ["url"], - "unevaluatedProperties": false - }, - - "xml": { - "$ref": "#/$defs/extensible", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "namespace": { - "type": "string", - "format": "uri" - }, - "prefix": { - "type": "string" - }, - "attribute": { - "type": "boolean" - }, - "wrapped": { - "type": "boolean" - } - }, - "unevaluatedProperties": false - } - } -} diff --git a/schemas/v3.1/schema-base.json b/schemas/v3.1/schema-base.json deleted file mode 100644 index b48dbac104..0000000000 --- a/schemas/v3.1/schema-base.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$id": "https://spec.openapis.org/oas/3.1/schema-base/2022-10-07", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The description of OpenAPI v3.1.x documents using the OpenAPI JSON Schema dialect, as defined by https://spec.openapis.org/oas/v3.1.0", - "$ref": "https://spec.openapis.org/oas/3.1/schema/2022-10-07", - "properties": { - "jsonSchemaDialect": { - "$ref": "#/$defs/dialect" - } - }, - "$defs": { - "dialect": { - "const": "https://spec.openapis.org/oas/3.1/dialect/base" - }, - "schema": { - "$dynamicAnchor": "meta", - "$ref": "https://spec.openapis.org/oas/3.1/dialect/base", - "properties": { - "$schema": { - "$ref": "#/$defs/dialect" - } - } - } - } -} \ No newline at end of file diff --git a/schemas/v3.1/schema.json b/schemas/v3.1/schema.json deleted file mode 100644 index 0fa9d5b3ad..0000000000 --- a/schemas/v3.1/schema.json +++ /dev/null @@ -1,1408 +0,0 @@ -{ - "$id": "https://spec.openapis.org/oas/3.1/schema/2022-10-07", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "description": "The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0", - "type": "object", - "properties": { - "openapi": { - "type": "string", - "pattern": "^3\\.1\\.\\d+(-.+)?$" - }, - "info": { - "$ref": "#/$defs/info" - }, - "jsonSchemaDialect": { - "type": "string", - "format": "uri", - "default": "https://spec.openapis.org/oas/3.1/dialect/base" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/$defs/server" - }, - "default": [ - { - "url": "/" - } - ] - }, - "paths": { - "$ref": "#/$defs/paths" - }, - "webhooks": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/path-item" - } - }, - "components": { - "$ref": "#/$defs/components" - }, - "security": { - "type": "array", - "items": { - "$ref": "#/$defs/security-requirement" - } - }, - "tags": { - "type": "array", - "items": { - "$ref": "#/$defs/tag" - } - }, - "externalDocs": { - "$ref": "#/$defs/external-documentation" - } - }, - "required": [ - "openapi", - "info" - ], - "anyOf": [ - { - "required": [ - "paths" - ] - }, - { - "required": [ - "components" - ] - }, - { - "required": [ - "webhooks" - ] - } - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false, - "$defs": { - "info": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#info-object", - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "termsOfService": { - "type": "string", - "format": "uri" - }, - "contact": { - "$ref": "#/$defs/contact" - }, - "license": { - "$ref": "#/$defs/license" - }, - "version": { - "type": "string" - } - }, - "required": [ - "title", - "version" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "contact": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#contact-object", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - }, - "email": { - "type": "string", - "format": "email" - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "license": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#license-object", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "identifier": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "required": [ - "name" - ], - "dependentSchemas": { - "identifier": { - "not": { - "required": [ - "url" - ] - } - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "server": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#server-object", - "type": "object", - "properties": { - "url": { - "type": "string" - }, - "description": { - "type": "string" - }, - "variables": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/server-variable" - } - } - }, - "required": [ - "url" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "server-variable": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#server-variable-object", - "type": "object", - "properties": { - "enum": { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "default": { - "type": "string" - }, - "description": { - "type": "string" - } - }, - "required": [ - "default" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "components": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#components-object", - "type": "object", - "properties": { - "schemas": { - "type": "object", - "additionalProperties": { - "$dynamicRef": "#meta" - } - }, - "responses": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/response-or-reference" - } - }, - "parameters": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/parameter-or-reference" - } - }, - "examples": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/example-or-reference" - } - }, - "requestBodies": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/request-body-or-reference" - } - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/header-or-reference" - } - }, - "securitySchemes": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/security-scheme-or-reference" - } - }, - "links": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/link-or-reference" - } - }, - "callbacks": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/callbacks-or-reference" - } - }, - "pathItems": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/path-item" - } - } - }, - "patternProperties": { - "^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$": { - "$comment": "Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected", - "propertyNames": { - "pattern": "^[a-zA-Z0-9._-]+$" - } - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "paths": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#paths-object", - "type": "object", - "patternProperties": { - "^/": { - "$ref": "#/$defs/path-item" - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "path-item": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#path-item-object", - "type": "object", - "properties": { - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/$defs/server" - } - }, - "parameters": { - "type": "array", - "items": { - "$ref": "#/$defs/parameter-or-reference" - } - }, - "get": { - "$ref": "#/$defs/operation" - }, - "put": { - "$ref": "#/$defs/operation" - }, - "post": { - "$ref": "#/$defs/operation" - }, - "delete": { - "$ref": "#/$defs/operation" - }, - "options": { - "$ref": "#/$defs/operation" - }, - "head": { - "$ref": "#/$defs/operation" - }, - "patch": { - "$ref": "#/$defs/operation" - }, - "trace": { - "$ref": "#/$defs/operation" - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "operation": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#operation-object", - "type": "object", - "properties": { - "tags": { - "type": "array", - "items": { - "type": "string" - } - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/$defs/external-documentation" - }, - "operationId": { - "type": "string" - }, - "parameters": { - "type": "array", - "items": { - "$ref": "#/$defs/parameter-or-reference" - } - }, - "requestBody": { - "$ref": "#/$defs/request-body-or-reference" - }, - "responses": { - "$ref": "#/$defs/responses" - }, - "callbacks": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/callbacks-or-reference" - } - }, - "deprecated": { - "default": false, - "type": "boolean" - }, - "security": { - "type": "array", - "items": { - "$ref": "#/$defs/security-requirement" - } - }, - "servers": { - "type": "array", - "items": { - "$ref": "#/$defs/server" - } - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "external-documentation": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#external-documentation-object", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "required": [ - "url" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "parameter": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#parameter-object", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "in": { - "enum": [ - "query", - "header", - "path", - "cookie" - ] - }, - "description": { - "type": "string" - }, - "required": { - "default": false, - "type": "boolean" - }, - "deprecated": { - "default": false, - "type": "boolean" - }, - "schema": { - "$dynamicRef": "#meta" - }, - "content": { - "$ref": "#/$defs/content", - "minProperties": 1, - "maxProperties": 1 - } - }, - "required": [ - "name", - "in" - ], - "oneOf": [ - { - "required": [ - "schema" - ] - }, - { - "required": [ - "content" - ] - } - ], - "if": { - "properties": { - "in": { - "const": "query" - } - }, - "required": [ - "in" - ] - }, - "then": { - "properties": { - "allowEmptyValue": { - "default": false, - "type": "boolean" - } - } - }, - "dependentSchemas": { - "schema": { - "properties": { - "style": { - "type": "string" - }, - "explode": { - "type": "boolean" - } - }, - "allOf": [ - { - "$ref": "#/$defs/examples" - }, - { - "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path" - }, - { - "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header" - }, - { - "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query" - }, - { - "$ref": "#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie" - }, - { - "$ref": "#/$defs/styles-for-form" - } - ], - "$defs": { - "styles-for-path": { - "if": { - "properties": { - "in": { - "const": "path" - } - }, - "required": [ - "in" - ] - }, - "then": { - "properties": { - "style": { - "default": "simple", - "enum": [ - "matrix", - "label", - "simple" - ] - }, - "required": { - "const": true - } - }, - "required": [ - "required" - ] - } - }, - "styles-for-header": { - "if": { - "properties": { - "in": { - "const": "header" - } - }, - "required": [ - "in" - ] - }, - "then": { - "properties": { - "style": { - "default": "simple", - "const": "simple" - } - } - } - }, - "styles-for-query": { - "if": { - "properties": { - "in": { - "const": "query" - } - }, - "required": [ - "in" - ] - }, - "then": { - "properties": { - "style": { - "default": "form", - "enum": [ - "form", - "spaceDelimited", - "pipeDelimited", - "deepObject" - ] - }, - "allowReserved": { - "default": false, - "type": "boolean" - } - } - } - }, - "styles-for-cookie": { - "if": { - "properties": { - "in": { - "const": "cookie" - } - }, - "required": [ - "in" - ] - }, - "then": { - "properties": { - "style": { - "default": "form", - "const": "form" - } - } - } - } - } - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "parameter-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/parameter" - } - }, - "request-body": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#request-body-object", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "content": { - "$ref": "#/$defs/content" - }, - "required": { - "default": false, - "type": "boolean" - } - }, - "required": [ - "content" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "request-body-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/request-body" - } - }, - "content": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#fixed-fields-10", - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/media-type" - }, - "propertyNames": { - "format": "media-range" - } - }, - "media-type": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#media-type-object", - "type": "object", - "properties": { - "schema": { - "$dynamicRef": "#meta" - }, - "encoding": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/encoding" - } - } - }, - "allOf": [ - { - "$ref": "#/$defs/specification-extensions" - }, - { - "$ref": "#/$defs/examples" - } - ], - "unevaluatedProperties": false - }, - "encoding": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#encoding-object", - "type": "object", - "properties": { - "contentType": { - "type": "string", - "format": "media-range" - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/header-or-reference" - } - }, - "style": { - "default": "form", - "enum": [ - "form", - "spaceDelimited", - "pipeDelimited", - "deepObject" - ] - }, - "explode": { - "type": "boolean" - }, - "allowReserved": { - "default": false, - "type": "boolean" - } - }, - "allOf": [ - { - "$ref": "#/$defs/specification-extensions" - }, - { - "$ref": "#/$defs/styles-for-form" - } - ], - "unevaluatedProperties": false - }, - "responses": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#responses-object", - "type": "object", - "properties": { - "default": { - "$ref": "#/$defs/response-or-reference" - } - }, - "patternProperties": { - "^[1-5](?:[0-9]{2}|XX)$": { - "$ref": "#/$defs/response-or-reference" - } - }, - "minProperties": 1, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false, - "if": { - "$comment": "either default, or at least one response code property must exist", - "patternProperties": { - "^[1-5](?:[0-9]{2}|XX)$": false - } - }, - "then": { - "required": [ - "default" - ] - } - }, - "response": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#response-object", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "headers": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/header-or-reference" - } - }, - "content": { - "$ref": "#/$defs/content" - }, - "links": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/link-or-reference" - } - } - }, - "required": [ - "description" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "response-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/response" - } - }, - "callbacks": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#callback-object", - "type": "object", - "$ref": "#/$defs/specification-extensions", - "additionalProperties": { - "$ref": "#/$defs/path-item" - } - }, - "callbacks-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/callbacks" - } - }, - "example": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#example-object", - "type": "object", - "properties": { - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "value": true, - "externalValue": { - "type": "string", - "format": "uri" - } - }, - "not": { - "required": [ - "value", - "externalValue" - ] - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "example-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/example" - } - }, - "link": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#link-object", - "type": "object", - "properties": { - "operationRef": { - "type": "string", - "format": "uri-reference" - }, - "operationId": { - "type": "string" - }, - "parameters": { - "$ref": "#/$defs/map-of-strings" - }, - "requestBody": true, - "description": { - "type": "string" - }, - "body": { - "$ref": "#/$defs/server" - } - }, - "oneOf": [ - { - "required": [ - "operationRef" - ] - }, - { - "required": [ - "operationId" - ] - } - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "link-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/link" - } - }, - "header": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#header-object", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "required": { - "default": false, - "type": "boolean" - }, - "deprecated": { - "default": false, - "type": "boolean" - }, - "schema": { - "$dynamicRef": "#meta" - }, - "content": { - "$ref": "#/$defs/content", - "minProperties": 1, - "maxProperties": 1 - } - }, - "oneOf": [ - { - "required": [ - "schema" - ] - }, - { - "required": [ - "content" - ] - } - ], - "dependentSchemas": { - "schema": { - "properties": { - "style": { - "default": "simple", - "const": "simple" - }, - "explode": { - "default": false, - "type": "boolean" - } - }, - "$ref": "#/$defs/examples" - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "header-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/header" - } - }, - "tag": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#tag-object", - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "#/$defs/external-documentation" - } - }, - "required": [ - "name" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "reference": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#reference-object", - "type": "object", - "properties": { - "$ref": { - "type": "string", - "format": "uri-reference" - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - } - } - }, - "schema": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#schema-object", - "$dynamicAnchor": "meta", - "type": [ - "object", - "boolean" - ] - }, - "security-scheme": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#security-scheme-object", - "type": "object", - "properties": { - "type": { - "enum": [ - "apiKey", - "http", - "mutualTLS", - "oauth2", - "openIdConnect" - ] - }, - "description": { - "type": "string" - } - }, - "required": [ - "type" - ], - "allOf": [ - { - "$ref": "#/$defs/specification-extensions" - }, - { - "$ref": "#/$defs/security-scheme/$defs/type-apikey" - }, - { - "$ref": "#/$defs/security-scheme/$defs/type-http" - }, - { - "$ref": "#/$defs/security-scheme/$defs/type-http-bearer" - }, - { - "$ref": "#/$defs/security-scheme/$defs/type-oauth2" - }, - { - "$ref": "#/$defs/security-scheme/$defs/type-oidc" - } - ], - "unevaluatedProperties": false, - "$defs": { - "type-apikey": { - "if": { - "properties": { - "type": { - "const": "apiKey" - } - }, - "required": [ - "type" - ] - }, - "then": { - "properties": { - "name": { - "type": "string" - }, - "in": { - "enum": [ - "query", - "header", - "cookie" - ] - } - }, - "required": [ - "name", - "in" - ] - } - }, - "type-http": { - "if": { - "properties": { - "type": { - "const": "http" - } - }, - "required": [ - "type" - ] - }, - "then": { - "properties": { - "scheme": { - "type": "string" - } - }, - "required": [ - "scheme" - ] - } - }, - "type-http-bearer": { - "if": { - "properties": { - "type": { - "const": "http" - }, - "scheme": { - "type": "string", - "pattern": "^[Bb][Ee][Aa][Rr][Ee][Rr]$" - } - }, - "required": [ - "type", - "scheme" - ] - }, - "then": { - "properties": { - "bearerFormat": { - "type": "string" - } - } - } - }, - "type-oauth2": { - "if": { - "properties": { - "type": { - "const": "oauth2" - } - }, - "required": [ - "type" - ] - }, - "then": { - "properties": { - "flows": { - "$ref": "#/$defs/oauth-flows" - } - }, - "required": [ - "flows" - ] - } - }, - "type-oidc": { - "if": { - "properties": { - "type": { - "const": "openIdConnect" - } - }, - "required": [ - "type" - ] - }, - "then": { - "properties": { - "openIdConnectUrl": { - "type": "string", - "format": "uri" - } - }, - "required": [ - "openIdConnectUrl" - ] - } - } - } - }, - "security-scheme-or-reference": { - "if": { - "type": "object", - "required": [ - "$ref" - ] - }, - "then": { - "$ref": "#/$defs/reference" - }, - "else": { - "$ref": "#/$defs/security-scheme" - } - }, - "oauth-flows": { - "type": "object", - "properties": { - "implicit": { - "$ref": "#/$defs/oauth-flows/$defs/implicit" - }, - "password": { - "$ref": "#/$defs/oauth-flows/$defs/password" - }, - "clientCredentials": { - "$ref": "#/$defs/oauth-flows/$defs/client-credentials" - }, - "authorizationCode": { - "$ref": "#/$defs/oauth-flows/$defs/authorization-code" - } - }, - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false, - "$defs": { - "implicit": { - "type": "object", - "properties": { - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "refreshUrl": { - "type": "string", - "format": "uri" - }, - "scopes": { - "$ref": "#/$defs/map-of-strings" - } - }, - "required": [ - "authorizationUrl", - "scopes" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "password": { - "type": "object", - "properties": { - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "refreshUrl": { - "type": "string", - "format": "uri" - }, - "scopes": { - "$ref": "#/$defs/map-of-strings" - } - }, - "required": [ - "tokenUrl", - "scopes" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "client-credentials": { - "type": "object", - "properties": { - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "refreshUrl": { - "type": "string", - "format": "uri" - }, - "scopes": { - "$ref": "#/$defs/map-of-strings" - } - }, - "required": [ - "tokenUrl", - "scopes" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - }, - "authorization-code": { - "type": "object", - "properties": { - "authorizationUrl": { - "type": "string", - "format": "uri" - }, - "tokenUrl": { - "type": "string", - "format": "uri" - }, - "refreshUrl": { - "type": "string", - "format": "uri" - }, - "scopes": { - "$ref": "#/$defs/map-of-strings" - } - }, - "required": [ - "authorizationUrl", - "tokenUrl", - "scopes" - ], - "$ref": "#/$defs/specification-extensions", - "unevaluatedProperties": false - } - } - }, - "security-requirement": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#security-requirement-object", - "type": "object", - "additionalProperties": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "specification-extensions": { - "$comment": "https://spec.openapis.org/oas/v3.1.0#specification-extensions", - "patternProperties": { - "^x-": true - } - }, - "examples": { - "properties": { - "example": true, - "examples": { - "type": "object", - "additionalProperties": { - "$ref": "#/$defs/example-or-reference" - } - } - } - }, - "map-of-strings": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "styles-for-form": { - "if": { - "properties": { - "style": { - "const": "form" - } - }, - "required": [ - "style" - ] - }, - "then": { - "properties": { - "explode": { - "default": true - } - } - }, - "else": { - "properties": { - "explode": { - "default": false - } - } - } - } - } -} \ No newline at end of file diff --git a/tests/v3.0/examples.test.js b/tests/v3.0/examples.test.js index 9513cbc9e3..19c13de13c 100644 --- a/tests/v3.0/examples.test.js +++ b/tests/v3.0/examples.test.js @@ -4,6 +4,21 @@ import { validate, setMetaSchemaOutputFormat } from "@hyperjump/json-schema/open import { BASIC } from "@hyperjump/json-schema/experimental"; import { describe, test, expect } from "vitest"; +import contentTypeParser from "content-type"; +import { addMediaTypePlugin } from "@hyperjump/browser"; +import { buildSchemaDocument } from "@hyperjump/json-schema/experimental"; + +addMediaTypePlugin("application/schema+yaml", { + parse: async (response) => { + const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? ""); + const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile; + + const foo = YAML.parse(await response.text()); + return buildSchemaDocument(foo, response.url, contextDialectId); + }, + fileMatcher: (path) => path.endsWith(".yaml") + }); + const parseYamlFromFile = (filePath) => { const schemaYaml = readFileSync(filePath, "utf8"); return YAML.parse(schemaYaml, { prettyErrors: true }); @@ -11,7 +26,7 @@ const parseYamlFromFile = (filePath) => { setMetaSchemaOutputFormat(BASIC); -const validateOpenApi = await validate("./schemas/v3.0/schema.json"); +const validateOpenApi = await validate("./schemas/v3.0/schema.yaml"); const folder = './examples/v3.0/'; describe("v3.0 - Validate examples", async () => { diff --git a/tests/v3.1/examples.test.js b/tests/v3.1/examples.test.js index 49057fb537..d23fc0ffda 100644 --- a/tests/v3.1/examples.test.js +++ b/tests/v3.1/examples.test.js @@ -4,6 +4,21 @@ import { validate, setMetaSchemaOutputFormat } from "@hyperjump/json-schema/open import { BASIC } from "@hyperjump/json-schema/experimental"; import { describe, test, expect } from "vitest"; +import contentTypeParser from "content-type"; +import { addMediaTypePlugin } from "@hyperjump/browser"; +import { buildSchemaDocument } from "@hyperjump/json-schema/experimental"; + +addMediaTypePlugin("application/schema+yaml", { + parse: async (response) => { + const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? ""); + const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile; + + const foo = YAML.parse(await response.text()); + return buildSchemaDocument(foo, response.url, contextDialectId); + }, + fileMatcher: (path) => path.endsWith(".yaml") + }); + const parseYamlFromFile = (filePath) => { const schemaYaml = readFileSync(filePath, "utf8"); return YAML.parse(schemaYaml, { prettyErrors: true }); @@ -11,7 +26,7 @@ const parseYamlFromFile = (filePath) => { setMetaSchemaOutputFormat(BASIC); -const validateOpenApi = await validate("./schemas/v3.1/schema.json"); +const validateOpenApi = await validate("./schemas/v3.1/schema.yaml"); const folder = './examples/v3.1/'; describe("v3.1 - Validate examples", async () => { diff --git a/tests/v3.1/schema.test.mjs b/tests/v3.1/schema.test.mjs index 76d83258b2..ab56bbb754 100644 --- a/tests/v3.1/schema.test.mjs +++ b/tests/v3.1/schema.test.mjs @@ -4,6 +4,21 @@ import { validate, setMetaSchemaOutputFormat } from "@hyperjump/json-schema/open import { BASIC } from "@hyperjump/json-schema/experimental"; import { describe, test, expect } from "vitest"; +import contentTypeParser from "content-type"; +import { addMediaTypePlugin } from "@hyperjump/browser"; +import { buildSchemaDocument } from "@hyperjump/json-schema/experimental"; + +addMediaTypePlugin("application/schema+yaml", { + parse: async (response) => { + const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? ""); + const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile; + + const foo = YAML.parse(await response.text()); + return buildSchemaDocument(foo, response.url, contextDialectId); + }, + fileMatcher: (path) => path.endsWith(".yaml") + }); + const parseYamlFromFile = (filePath) => { const schemaYaml = readFileSync(filePath, "utf8"); return YAML.parse(schemaYaml, { prettyErrors: true }); @@ -11,7 +26,7 @@ const parseYamlFromFile = (filePath) => { setMetaSchemaOutputFormat(BASIC); -const validateOpenApi = await validate("./schemas/v3.1/schema.json"); +const validateOpenApi = await validate("./schemas/v3.1/schema.yaml"); describe("v3.1", () => { describe("Pass", () => { From 1437630ed33e1cc6715a637b8f7df19b838f65c9 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 10:09:45 +0200 Subject: [PATCH 08/12] Refresh package.json --- package-lock.json | 205 +++++++++++++++++++++++++++++----------------- package.json | 4 +- 2 files changed, 134 insertions(+), 75 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75b58b2d24..b7e9344ff4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,8 +20,8 @@ "c8": "^10.1.2", "markdownlint-cli": "^0.42.0", "mdv": "^1.3.4", - "vitest": "^2.1.2", - "yaml": "^2.5.1" + "vitest": "^2.1.3", + "yaml": "^2.6.0" } }, "node_modules/@babel/code-frame": { @@ -73,6 +73,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "aix" @@ -89,6 +90,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -105,6 +107,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -121,6 +124,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -137,6 +141,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -153,6 +158,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -169,6 +175,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -185,6 +192,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -201,6 +209,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -217,6 +226,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -233,6 +243,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -249,6 +260,7 @@ "loong64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -265,6 +277,7 @@ "mips64el" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -281,6 +294,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -297,6 +311,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -313,6 +328,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -329,6 +345,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -345,6 +362,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -361,6 +379,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -377,6 +396,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "sunos" @@ -393,6 +413,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -409,6 +430,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -425,6 +447,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -629,6 +652,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -642,6 +666,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "android" @@ -655,6 +680,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -668,6 +694,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -681,6 +708,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -694,6 +722,7 @@ "arm" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -707,6 +736,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -720,6 +750,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -733,6 +764,7 @@ "ppc64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -746,6 +778,7 @@ "riscv64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -759,6 +792,7 @@ "s390x" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -772,6 +806,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -785,6 +820,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "linux" @@ -798,6 +834,7 @@ "arm64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -811,6 +848,7 @@ "ia32" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -824,6 +862,7 @@ "x64" ], "dev": true, + "license": "MIT", "optional": true, "os": [ "win32" @@ -838,7 +877,8 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -867,13 +907,14 @@ } }, "node_modules/@vitest/expect": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.2.tgz", - "integrity": "sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.3.tgz", + "integrity": "sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "2.1.2", - "@vitest/utils": "2.1.2", + "@vitest/spy": "2.1.3", + "@vitest/utils": "2.1.3", "chai": "^5.1.1", "tinyrainbow": "^1.2.0" }, @@ -882,12 +923,13 @@ } }, "node_modules/@vitest/mocker": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.2.tgz", - "integrity": "sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.3.tgz", + "integrity": "sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/spy": "^2.1.0-beta.1", + "@vitest/spy": "2.1.3", "estree-walker": "^3.0.3", "magic-string": "^0.30.11" }, @@ -895,7 +937,7 @@ "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "@vitest/spy": "2.1.2", + "@vitest/spy": "2.1.3", "msw": "^2.3.5", "vite": "^5.0.0" }, @@ -909,10 +951,11 @@ } }, "node_modules/@vitest/pretty-format": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.2.tgz", - "integrity": "sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.3.tgz", + "integrity": "sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==", "dev": true, + "license": "MIT", "dependencies": { "tinyrainbow": "^1.2.0" }, @@ -921,12 +964,13 @@ } }, "node_modules/@vitest/runner": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.2.tgz", - "integrity": "sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.3.tgz", + "integrity": "sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/utils": "2.1.2", + "@vitest/utils": "2.1.3", "pathe": "^1.1.2" }, "funding": { @@ -934,12 +978,13 @@ } }, "node_modules/@vitest/snapshot": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.2.tgz", - "integrity": "sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.3.tgz", + "integrity": "sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.2", + "@vitest/pretty-format": "2.1.3", "magic-string": "^0.30.11", "pathe": "^1.1.2" }, @@ -948,10 +993,11 @@ } }, "node_modules/@vitest/spy": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.2.tgz", - "integrity": "sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.3.tgz", + "integrity": "sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==", "dev": true, + "license": "MIT", "dependencies": { "tinyspy": "^3.0.0" }, @@ -960,12 +1006,13 @@ } }, "node_modules/@vitest/utils": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.2.tgz", - "integrity": "sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.3.tgz", + "integrity": "sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/pretty-format": "2.1.2", + "@vitest/pretty-format": "2.1.3", "loupe": "^3.1.1", "tinyrainbow": "^1.2.0" }, @@ -1056,6 +1103,7 @@ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, + "license": "MIT", "engines": { "node": ">=12" } @@ -1238,6 +1286,7 @@ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -1255,6 +1304,7 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, + "license": "MIT", "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", @@ -1303,6 +1353,7 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, + "license": "MIT", "engines": { "node": ">= 16" } @@ -1613,6 +1664,7 @@ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } @@ -1823,6 +1875,7 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1923,6 +1976,7 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -2084,6 +2138,7 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -2101,15 +2156,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "dev": true, - "engines": { - "node": "*" - } - }, "node_modules/get-stdin": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-9.0.0.tgz", @@ -2660,13 +2706,11 @@ "license": "MIT" }, "node_modules/loupe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.1.tgz", - "integrity": "sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", + "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.1" - } + "license": "MIT" }, "node_modules/lru-cache": { "version": "10.4.3", @@ -2676,10 +2720,11 @@ "license": "ISC" }, "node_modules/magic-string": { - "version": "0.30.11", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.11.tgz", - "integrity": "sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A==", + "version": "0.30.12", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", + "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -3066,6 +3111,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -3347,13 +3393,15 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, + "license": "MIT", "engines": { "node": ">= 14.16" } @@ -3387,6 +3435,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.0", @@ -3613,6 +3662,7 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", "dev": true, + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -3865,6 +3915,7 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -4119,6 +4170,7 @@ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -4128,6 +4180,7 @@ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -4234,10 +4287,11 @@ } }, "node_modules/vite": { - "version": "5.4.8", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", - "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", + "version": "5.4.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", + "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", "dev": true, + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -4293,10 +4347,11 @@ } }, "node_modules/vite-node": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.2.tgz", - "integrity": "sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.3.tgz", + "integrity": "sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==", "dev": true, + "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.6", @@ -4318,6 +4373,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -4334,21 +4390,23 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/vitest": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.2.tgz", - "integrity": "sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.3.tgz", + "integrity": "sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==", "dev": true, + "license": "MIT", "dependencies": { - "@vitest/expect": "2.1.2", - "@vitest/mocker": "2.1.2", - "@vitest/pretty-format": "^2.1.2", - "@vitest/runner": "2.1.2", - "@vitest/snapshot": "2.1.2", - "@vitest/spy": "2.1.2", - "@vitest/utils": "2.1.2", + "@vitest/expect": "2.1.3", + "@vitest/mocker": "2.1.3", + "@vitest/pretty-format": "^2.1.3", + "@vitest/runner": "2.1.3", + "@vitest/snapshot": "2.1.3", + "@vitest/spy": "2.1.3", + "@vitest/utils": "2.1.3", "chai": "^5.1.1", "debug": "^4.3.6", "magic-string": "^0.30.11", @@ -4359,7 +4417,7 @@ "tinypool": "^1.0.0", "tinyrainbow": "^1.2.0", "vite": "^5.0.0", - "vite-node": "2.1.2", + "vite-node": "2.1.3", "why-is-node-running": "^2.3.0" }, "bin": { @@ -4374,8 +4432,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "2.1.2", - "@vitest/ui": "2.1.2", + "@vitest/browser": "2.1.3", + "@vitest/ui": "2.1.3", "happy-dom": "*", "jsdom": "*" }, @@ -4646,10 +4704,11 @@ } }, "node_modules/yaml": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", - "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", + "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", "dev": true, + "license": "ISC", "bin": { "yaml": "bin.mjs" }, diff --git a/package.json b/package.json index abdb7dce9c..8b4e5c6123 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "c8": "^10.1.2", "markdownlint-cli": "^0.42.0", "mdv": "^1.3.4", - "vitest": "^2.1.2", - "yaml": "^2.5.1" + "vitest": "^2.1.3", + "yaml": "^2.6.0" }, "keywords": [ "OpenAPI", From a01f8b35ccc3924d4a47467c778e7f9191bcdbba Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 10:11:21 +0200 Subject: [PATCH 09/12] Update package-lock.json --- package-lock.json | 79 +++-------------------------------------------- 1 file changed, 4 insertions(+), 75 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7e9344ff4..301f7b23db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,7 +73,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "aix" @@ -90,7 +89,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -107,7 +105,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -124,7 +121,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -141,7 +137,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -158,7 +153,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -175,7 +169,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -192,7 +185,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "freebsd" @@ -209,7 +201,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -226,7 +217,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -243,7 +233,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -260,7 +249,6 @@ "loong64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -277,7 +265,6 @@ "mips64el" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -294,7 +281,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -311,7 +297,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -328,7 +313,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -345,7 +329,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -362,7 +345,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "netbsd" @@ -379,7 +361,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "openbsd" @@ -396,7 +377,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "sunos" @@ -413,7 +393,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -430,7 +409,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -447,7 +425,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -652,7 +629,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -666,7 +642,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "android" @@ -680,7 +655,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -694,7 +668,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -708,7 +681,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -722,7 +694,6 @@ "arm" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -736,7 +707,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -750,7 +720,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -764,7 +733,6 @@ "ppc64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -778,7 +746,6 @@ "riscv64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -792,7 +759,6 @@ "s390x" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -806,7 +772,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -820,7 +785,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "linux" @@ -834,7 +798,6 @@ "arm64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -848,7 +811,6 @@ "ia32" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -862,7 +824,6 @@ "x64" ], "dev": true, - "license": "MIT", "optional": true, "os": [ "win32" @@ -877,8 +838,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -911,7 +871,6 @@ "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.3.tgz", "integrity": "sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/spy": "2.1.3", "@vitest/utils": "2.1.3", @@ -927,7 +886,6 @@ "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.3.tgz", "integrity": "sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/spy": "2.1.3", "estree-walker": "^3.0.3", @@ -955,7 +913,6 @@ "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.3.tgz", "integrity": "sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==", "dev": true, - "license": "MIT", "dependencies": { "tinyrainbow": "^1.2.0" }, @@ -968,7 +925,6 @@ "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.3.tgz", "integrity": "sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/utils": "2.1.3", "pathe": "^1.1.2" @@ -982,7 +938,6 @@ "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.3.tgz", "integrity": "sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/pretty-format": "2.1.3", "magic-string": "^0.30.11", @@ -997,7 +952,6 @@ "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.3.tgz", "integrity": "sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==", "dev": true, - "license": "MIT", "dependencies": { "tinyspy": "^3.0.0" }, @@ -1010,7 +964,6 @@ "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.3.tgz", "integrity": "sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/pretty-format": "2.1.3", "loupe": "^3.1.1", @@ -1103,7 +1056,6 @@ "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", "dev": true, - "license": "MIT", "engines": { "node": ">=12" } @@ -1286,7 +1238,6 @@ "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } @@ -1304,7 +1255,6 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, - "license": "MIT", "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", @@ -1353,7 +1303,6 @@ "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, - "license": "MIT", "engines": { "node": ">= 16" } @@ -1664,7 +1613,6 @@ "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -1875,7 +1823,6 @@ "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1976,7 +1923,6 @@ "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dev": true, - "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -2138,7 +2084,6 @@ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "optional": true, "os": [ "darwin" @@ -2709,8 +2654,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.2.tgz", "integrity": "sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/lru-cache": { "version": "10.4.3", @@ -2724,7 +2668,6 @@ "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.12.tgz", "integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==", "dev": true, - "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -3111,7 +3054,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -3393,15 +3335,13 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/pathval": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, - "license": "MIT", "engines": { "node": ">= 14.16" } @@ -3435,7 +3375,6 @@ "url": "https://github.com/sponsors/ai" } ], - "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.0", @@ -3662,7 +3601,6 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.24.0.tgz", "integrity": "sha512-DOmrlGSXNk1DM0ljiQA+i+o0rSLhtii1je5wgk60j49d1jHT5YYttBv1iWOnYSTG+fZZESUOSNiAl89SIet+Cg==", "dev": true, - "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -3915,7 +3853,6 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "dev": true, - "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -4170,7 +4107,6 @@ "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -4180,7 +4116,6 @@ "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", "dev": true, - "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -4291,7 +4226,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", "dev": true, - "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -4351,7 +4285,6 @@ "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.3.tgz", "integrity": "sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==", "dev": true, - "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.6", @@ -4373,7 +4306,6 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", "dev": true, - "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -4390,15 +4322,13 @@ "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/vitest": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.3.tgz", "integrity": "sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==", "dev": true, - "license": "MIT", "dependencies": { "@vitest/expect": "2.1.3", "@vitest/mocker": "2.1.3", @@ -4708,7 +4638,6 @@ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.6.0.tgz", "integrity": "sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==", "dev": true, - "license": "ISC", "bin": { "yaml": "bin.mjs" }, From 0016a581ffd2baf271922bd6a95a2cfcb9369039 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 10:26:49 +0200 Subject: [PATCH 10/12] Updated and aligned README.md --- schemas/v3.0/README.md | 27 ++++++++++++++++++++------- schemas/v3.1/README.md | 23 +++++++++-------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index 84956279da..ebe15ca73c 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -1,16 +1,29 @@ -OpenAPI 3.0.X JSON Schema ---- +# OpenAPI 3.0.X JSON Schema -Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.X. +Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.0.x. -As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance. +As a reminder, the JSON Schema is not the source of truth for the Specification. +In cases of conflicts between the Specification itself and the JSON Schema, the +Specification wins. Also, some Specification constraints cannot be represented +with the JSON Schema so it's highly recommended to employ other methods to +ensure compliance. -The iteration version of the JSON Schema can be found in the `id` field. For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019. +The iteration version of the JSON Schema can be found in the `id` field. +For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019. -To submit improvements to the schema, modify the schema.yaml file only. +To submit improvements to the schema, modify the `schema.yaml` file only. The TSC will then: - Run tests on the updated schema - Update the iteration version -- Convert the schema.yaml to schema.json +- Convert the `schema.yaml` to `schema.json` - Publish the new version + +## Tests + +The test suite is part of this package. + +```bash +npm install +npm test +``` diff --git a/schemas/v3.1/README.md b/schemas/v3.1/README.md index 01da62b56d..4509584071 100644 --- a/schemas/v3.1/README.md +++ b/schemas/v3.1/README.md @@ -1,7 +1,6 @@ # OpenAPI 3.1.X JSON Schema -Here you can find the JSON Schema for validating OpenAPI definitions of versions -3.1.X. +Here you can find the JSON Schema for validating OpenAPI definitions of versions 3.1.x. As a reminder, the JSON Schema is not the source of truth for the Specification. In cases of conflicts between the Specification itself and the JSON Schema, the @@ -9,9 +8,8 @@ Specification wins. Also, some Specification constraints cannot be represented with the JSON Schema so it's highly recommended to employ other methods to ensure compliance. -The iteration version of the JSON Schema can be found in the `$id` field. For -example, the value of `$id: https://spec.openapis.org/oas/3.1/schema/2021-03-02` -means this iteration was created on March 2nd, 2021. +The iteration version of the JSON Schema can be found in the `$id` field. +For example, the value of `$id: https://spec.openapis.org/oas/3.1/schema/2021-03-02` means this iteration was created on March 2nd, 2021. The `schema.yaml` schema doesn't validate the JSON Schemas in your OpenAPI document because 3.1 allows you to use any JSON Schema dialect you choose. We @@ -19,23 +17,20 @@ have also included `schema-base.yaml` that extends the main schema to validate that all schemas use the default OAS base vocabulary. ## Contributing -To submit improvements to the schema, modify the schema.yaml file only. + +To submit improvements to the schema, modify the `schema.yaml` file only. The TSC will then: - Run tests on the updated schema - Update the iteration version -- Convert the schema.yaml to schema.json +- Convert the `schema.yaml` to `schema.json` - Publish the new version ## Tests -The test suite is included as a git submodule of https://github.com/Mermade/openapi3-examples. - -```bash -npx mocha --recursive tests -``` -You can also validate a document individually. +The test suite is part of this package. ```bash -scripts/validate.js path/to/document/to/validate.yaml +npm install +npm test ``` From b4aa48efebb3474daf45bc9c99c0642b4154c54b Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 10:31:16 +0200 Subject: [PATCH 11/12] Further align, point to test suite --- schemas/v3.0/README.md | 7 ++++--- schemas/v3.1/README.md | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/schemas/v3.0/README.md b/schemas/v3.0/README.md index ebe15ca73c..05b242bd27 100644 --- a/schemas/v3.0/README.md +++ b/schemas/v3.0/README.md @@ -11,17 +11,18 @@ ensure compliance. The iteration version of the JSON Schema can be found in the `id` field. For example, the value of `id: https://spec.openapis.org/oas/3.0/schema/2019-04-02` means this iteration was created on April 2nd, 2019. -To submit improvements to the schema, modify the `schema.yaml` file only. +## Contributing + +To submit improvements to the schema, modify the `schema.yaml` and add test cases for your changes. The TSC will then: - Run tests on the updated schema - Update the iteration version -- Convert the `schema.yaml` to `schema.json` - Publish the new version ## Tests -The test suite is part of this package. +The [test suite](../../tests/v3.0) is part of this package. ```bash npm install diff --git a/schemas/v3.1/README.md b/schemas/v3.1/README.md index 4509584071..40ff09c40f 100644 --- a/schemas/v3.1/README.md +++ b/schemas/v3.1/README.md @@ -18,17 +18,16 @@ that all schemas use the default OAS base vocabulary. ## Contributing -To submit improvements to the schema, modify the `schema.yaml` file only. +To submit improvements to the schema, modify the `schema.yaml` and add test cases for your changes. The TSC will then: - Run tests on the updated schema - Update the iteration version -- Convert the `schema.yaml` to `schema.json` - Publish the new version ## Tests -The test suite is part of this package. +The [test suite](../../tests/v3.1) is part of this package. ```bash npm install From 7f19e32b28d2bf7df527d1f2d5eee784b34f5808 Mon Sep 17 00:00:00 2001 From: Ralf Handl Date: Wed, 16 Oct 2024 13:28:47 +0200 Subject: [PATCH 12/12] validate script --- schemas/v3.1/README.md | 6 ++++++ scripts/validate.mjs | 20 +++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/schemas/v3.1/README.md b/schemas/v3.1/README.md index 40ff09c40f..1e63e2bec5 100644 --- a/schemas/v3.1/README.md +++ b/schemas/v3.1/README.md @@ -33,3 +33,9 @@ The [test suite](../../tests/v3.1) is part of this package. npm install npm test ``` + +You can also validate a document individually. + +```bash +node scripts/validate.mjs path/to/document/to/validate.yaml +``` diff --git a/scripts/validate.mjs b/scripts/validate.mjs index 4d945e994f..202ac13c58 100755 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -1,10 +1,24 @@ #!/usr/bin/env node import { readFile } from "node:fs/promises"; -import yaml from "yaml"; +import YAML from "yaml"; import { setMetaSchemaOutputFormat, validate } from "@hyperjump/json-schema/openapi-3-1"; import { BASIC } from "@hyperjump/json-schema/experimental"; +import contentTypeParser from "content-type"; +import { addMediaTypePlugin } from "@hyperjump/browser"; +import { buildSchemaDocument } from "@hyperjump/json-schema/experimental"; + +addMediaTypePlugin("application/schema+yaml", { + parse: async (response) => { + const contentType = contentTypeParser.parse(response.headers.get("content-type") ?? ""); + const contextDialectId = contentType.parameters.schema ?? contentType.parameters.profile; + + const foo = YAML.parse(await response.text()); + return buildSchemaDocument(foo, response.url, contextDialectId); + }, + fileMatcher: (path) => path.endsWith(".yaml") + }); const defaultOutputFormat = BASIC; @@ -29,10 +43,10 @@ const outputFormat = args.format || defaultOutputFormat; setMetaSchemaOutputFormat(outputFormat); // Compile / meta-validate -const validateOpenApi = await validate(`./schemas/v3.1/${schemaType}.json`); +const validateOpenApi = await validate(`./schemas/v3.1/${schemaType}.yaml`); // Validate instance const instanceYaml = await readFile(`${process.argv[process.argv.length - 1]}`, "utf8"); -const instance = yaml.parse(instanceYaml); +const instance = YAML.parse(instanceYaml); const results = validateOpenApi(instance, outputFormat); console.log(JSON.stringify(results, null, " "));