diff --git a/package-lock.json b/package-lock.json index 0704de86d3..0f31041c73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "^7.11.2", - "@swagger-api/apidom-core": "=0.64.0", - "@swagger-api/apidom-json-pointer": "=0.64.0", - "@swagger-api/apidom-ns-openapi-3-1": "=0.64.0", - "@swagger-api/apidom-reference": "=0.64.0", + "@swagger-api/apidom-core": "=0.65.0", + "@swagger-api/apidom-json-pointer": "=0.65.0", + "@swagger-api/apidom-ns-openapi-3-1": "=0.65.0", + "@swagger-api/apidom-reference": "=0.65.0", "cookie": "~0.5.0", "cross-fetch": "^3.1.5", "deepmerge": "~4.2.2", @@ -6784,13 +6784,13 @@ } }, "node_modules/@swagger-api/apidom-ast": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ast/0.64.0/c9d95644e46c82be3ab535f25d73f8ef8c28493b", - "integrity": "sha512-7WzlTxXvXHKOBPHlJqIKomod8jteDnQlPeVeGWVyXLcyJ0GN4l0a/mJueXmNy4Slxwmm5oTfey2I60bOdPb9jQ==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ast/0.65.0/5f07e4fdde552b21dda8fed182c2715c5c681819", + "integrity": "sha512-mKOjZ7QEi3rX0A3y0EiEhjYtUKoofDEagwVDEDp3Hn+dzO7IowVjdhN1mIA67D+gYQV+c2yXhEWrNp+N/QomxA==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@types/ramda": "=0.28.20", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2", @@ -6798,14 +6798,14 @@ } }, "node_modules/@swagger-api/apidom-core": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-core/0.64.0/999305996b78ca84dd396c33c65aa4bd5e25aa11", - "integrity": "sha512-6zOTxq0HaS3RblfTyDk/GsPIT2A+KUmQVo23DZb9b/XsL9aq7NjEn2IAsoPaSaTkp+ewrFqetGxsuOtxNaqutw==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-core/0.65.0/0b28383836af7f597bb0f2788ed6e23146481a0e", + "integrity": "sha512-u+B07KGesKyrUfTK8XgvEjYQaEUGW5BItrsUobVqJbUg31/G3FYyb5Se/DoUls5bPdMNo4FDibolQuubSA399Q==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-ast": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-ast": "^0.65.0", + "@types/ramda": "=0.28.21", "minim": "=0.23.8", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", @@ -6814,13 +6814,13 @@ } }, "node_modules/@swagger-api/apidom-json-pointer": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-json-pointer/0.64.0/d50d655b847dd035c9ba8ebc7c989077693f2de8", - "integrity": "sha512-jMM6LQ/hd93qSuzAuxnLo6oUyWcREHh4uKE8zX7vRu9XE5vLYx2BGOqiMfx3oWDdc6Tb+ZweHGJ0cYmU9JCU7g==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-json-pointer/0.65.0/0bfd8ddd669c771ee4642d28d0c7bb90c7086330", + "integrity": "sha512-LJDA31yjf9PeQ4e9nk9UBuyOvc6nzfyOULohDfeBF/oclWTR+TKW51WtYH5SK+N5pBu9+UUQcRb0Bxj7uS+dAA==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", + "@swagger-api/apidom-core": "^0.65.0", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0" } @@ -6832,44 +6832,44 @@ "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" }, "node_modules/@swagger-api/apidom-ns-json-schema-draft-4": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-json-schema-draft-4/0.64.0/97955580d4cce4911f2a2c507c347c65116b60fb", - "integrity": "sha512-xAmE3KYbPGya5NgZyKSfrNdZjILlv1HceToBtAcz+j3FiFiC2E/KRJw0sF/DpJLp2FH3xJ5MYrCGbrnGMd/gIg==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-json-schema-draft-4/0.65.0/d780a0e44a99fee3cbe2426850fbdcd1dd6a416c", + "integrity": "sha512-zVlUAK0vXdZBF3Rt67wNrkmetiWqOB+fvbzHdCiQEo8M2I3+aRF4UqOxx67fDK50ypf/Fc7D0STM5RBIp466mg==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" } }, "node_modules/@swagger-api/apidom-ns-openapi-3-0": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-0/0.64.0/e2ca58fbad8d990c16c269e289d228e2dd4d27a3", - "integrity": "sha512-yt+Iy1V3tQLo73zxbYLnDW7Mrad8YPjiMZAFwWoI2AnuEbDYGX0wNgJy5mQewSGbU0NBcoalHoknj+thf8z1Ag==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-0/0.65.0/addcd9960885a1da5e67b13a45fa4619945049fc", + "integrity": "sha512-r8v/EbVIQpTrrlH18Gry/4S/yg6muvwNtLY1CctFJcPrEHniADZXr6Dwl79eagoYTUnPspavF+/ZW4Gs4LI67g==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-ns-json-schema-draft-4": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-ns-json-schema-draft-4": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" } }, "node_modules/@swagger-api/apidom-ns-openapi-3-1": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-1/0.64.0/a52a069ddc54bbce8d859257ae0ec42dbb38d6b2", - "integrity": "sha512-B9eHLFtic1cflr8+7w985zAHctjnRCtxE1nOxHa26zfgCT73QqUJnyiCVsbnfr9SunHLffETXUSLjtFNjZOTVw==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-1/0.65.0/634329302b7de4398f10a8f28c4d9e6e65d7118a", + "integrity": "sha512-0igHuPvcesdhRqDoRzm14q09eeBq0MVfYtaKg1fF0Vcl/nhxsm0iNUOHyXUE0s/b3nFhMYivCj62uNX+1OGhuw==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-ns-openapi-3-0": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-ns-openapi-3-0": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" @@ -6936,30 +6936,30 @@ "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" }, "node_modules/@swagger-api/apidom-reference": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-reference/0.64.0/3640b73d232c733ced93551c8b5ea47ab2ea3c3b", - "integrity": "sha512-dfdZ5SUmvOenpaukDFhH9RPH3ovt1W9mbvk5KMZlEwAGSzbnxbCPOlozPKIeLVPFPgH+vh/dJsCJE2MROHSReg==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-reference/0.65.0/24535cb921141e0e97d553b4194477307096feab", + "integrity": "sha512-k8KZhQiG02xEtS5Mg/NT3x1u5/QVerSDWSp12lqIWK+oHhSVDDHj5G4fjAbPmoqlc17wicxpAcL9N+uUYvMSow==", "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-json-pointer": "^0.64.0", - "@swagger-api/apidom-ns-asyncapi-2": "^0.64.0", - "@swagger-api/apidom-ns-openapi-3-0": "^0.64.0", - "@swagger-api/apidom-ns-openapi-3-1": "^0.64.0", - "@swagger-api/apidom-parser-adapter-api-design-systems-json": "^0.64.0", - "@swagger-api/apidom-parser-adapter-api-design-systems-yaml": "^0.64.0", - "@swagger-api/apidom-parser-adapter-asyncapi-json-2": "^0.64.0", - "@swagger-api/apidom-parser-adapter-asyncapi-yaml-2": "^0.64.0", - "@swagger-api/apidom-parser-adapter-json": "^0.64.0", - "@swagger-api/apidom-parser-adapter-openapi-json-3-0": "^0.64.0", - "@swagger-api/apidom-parser-adapter-openapi-json-3-1": "^0.64.0", - "@swagger-api/apidom-parser-adapter-openapi-yaml-3-0": "^0.64.0", - "@swagger-api/apidom-parser-adapter-openapi-yaml-3-1": "^0.64.0", - "@swagger-api/apidom-parser-adapter-yaml-1-2": "^0.64.0", - "@types/ramda": "=0.28.20", - "axios": "=1.2.2", - "minimatch": "=5.1.2", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-json-pointer": "^0.65.0", + "@swagger-api/apidom-ns-asyncapi-2": "^0.65.0", + "@swagger-api/apidom-ns-openapi-3-0": "^0.65.0", + "@swagger-api/apidom-ns-openapi-3-1": "^0.65.0", + "@swagger-api/apidom-parser-adapter-api-design-systems-json": "^0.65.0", + "@swagger-api/apidom-parser-adapter-api-design-systems-yaml": "^0.65.0", + "@swagger-api/apidom-parser-adapter-asyncapi-json-2": "^0.65.0", + "@swagger-api/apidom-parser-adapter-asyncapi-yaml-2": "^0.65.0", + "@swagger-api/apidom-parser-adapter-json": "^0.65.0", + "@swagger-api/apidom-parser-adapter-openapi-json-3-0": "^0.65.0", + "@swagger-api/apidom-parser-adapter-openapi-json-3-1": "^0.65.0", + "@swagger-api/apidom-parser-adapter-openapi-yaml-3-0": "^0.65.0", + "@swagger-api/apidom-parser-adapter-openapi-yaml-3-1": "^0.65.0", + "@swagger-api/apidom-parser-adapter-yaml-1-2": "^0.65.0", + "@types/ramda": "=0.28.21", + "axios": "=1.2.3", + "minimatch": "=6.1.5", "process": "=0.11.10", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", @@ -6975,14 +6975,17 @@ } }, "node_modules/@swagger-api/apidom-reference/node_modules/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.1.5.tgz", + "integrity": "sha512-2/WxnHMkH7qFS+pG8ibLN5GZdx5Y0aLlgFSghaKRUpkeEmC85wZRb/xDvj9jv601KdNOS2G/nNqj2h6k42yxBQ==", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@tootallnate/once": { @@ -7166,9 +7169,9 @@ "dev": true }, "node_modules/@types/ramda": { - "version": "0.28.20", - "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.28.20.tgz", - "integrity": "sha512-MeUhzGSXQTRsY19JGn5LIBTLxVEnyF6HDNr08KSJqybsm4DlfLIgK1jBHjhpiSyk252tXYmp+UOe0UFg0UiFsA==", + "version": "0.28.21", + "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.28.21.tgz", + "integrity": "sha512-yim1qtioaA304Px6eZ72WvE3D41+Ay696/VpSZ54VcY8DUZ6BCDbkE/Zvc0iudK8aXXXhEWV4opoKnlphxyRQw==", "dependencies": { "ts-toolbelt": "^6.15.1" } @@ -24935,12 +24938,12 @@ } }, "@swagger-api/apidom-ast": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ast/0.64.0/c9d95644e46c82be3ab535f25d73f8ef8c28493b", - "integrity": "sha512-7WzlTxXvXHKOBPHlJqIKomod8jteDnQlPeVeGWVyXLcyJ0GN4l0a/mJueXmNy4Slxwmm5oTfey2I60bOdPb9jQ==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ast/0.65.0/5f07e4fdde552b21dda8fed182c2715c5c681819", + "integrity": "sha512-mKOjZ7QEi3rX0A3y0EiEhjYtUKoofDEagwVDEDp3Hn+dzO7IowVjdhN1mIA67D+gYQV+c2yXhEWrNp+N/QomxA==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@types/ramda": "=0.28.20", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2", @@ -24948,13 +24951,13 @@ } }, "@swagger-api/apidom-core": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-core/0.64.0/999305996b78ca84dd396c33c65aa4bd5e25aa11", - "integrity": "sha512-6zOTxq0HaS3RblfTyDk/GsPIT2A+KUmQVo23DZb9b/XsL9aq7NjEn2IAsoPaSaTkp+ewrFqetGxsuOtxNaqutw==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-core/0.65.0/0b28383836af7f597bb0f2788ed6e23146481a0e", + "integrity": "sha512-u+B07KGesKyrUfTK8XgvEjYQaEUGW5BItrsUobVqJbUg31/G3FYyb5Se/DoUls5bPdMNo4FDibolQuubSA399Q==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-ast": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-ast": "^0.65.0", + "@types/ramda": "=0.28.21", "minim": "=0.23.8", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", @@ -24963,12 +24966,12 @@ } }, "@swagger-api/apidom-json-pointer": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-json-pointer/0.64.0/d50d655b847dd035c9ba8ebc7c989077693f2de8", - "integrity": "sha512-jMM6LQ/hd93qSuzAuxnLo6oUyWcREHh4uKE8zX7vRu9XE5vLYx2BGOqiMfx3oWDdc6Tb+ZweHGJ0cYmU9JCU7g==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-json-pointer/0.65.0/0bfd8ddd669c771ee4642d28d0c7bb90c7086330", + "integrity": "sha512-LJDA31yjf9PeQ4e9nk9UBuyOvc6nzfyOULohDfeBF/oclWTR+TKW51WtYH5SK+N5pBu9+UUQcRb0Bxj7uS+dAA==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", + "@swagger-api/apidom-core": "^0.65.0", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0" } @@ -24979,41 +24982,41 @@ "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" }, "@swagger-api/apidom-ns-json-schema-draft-4": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-json-schema-draft-4/0.64.0/97955580d4cce4911f2a2c507c347c65116b60fb", - "integrity": "sha512-xAmE3KYbPGya5NgZyKSfrNdZjILlv1HceToBtAcz+j3FiFiC2E/KRJw0sF/DpJLp2FH3xJ5MYrCGbrnGMd/gIg==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-json-schema-draft-4/0.65.0/d780a0e44a99fee3cbe2426850fbdcd1dd6a416c", + "integrity": "sha512-zVlUAK0vXdZBF3Rt67wNrkmetiWqOB+fvbzHdCiQEo8M2I3+aRF4UqOxx67fDK50ypf/Fc7D0STM5RBIp466mg==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" } }, "@swagger-api/apidom-ns-openapi-3-0": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-0/0.64.0/e2ca58fbad8d990c16c269e289d228e2dd4d27a3", - "integrity": "sha512-yt+Iy1V3tQLo73zxbYLnDW7Mrad8YPjiMZAFwWoI2AnuEbDYGX0wNgJy5mQewSGbU0NBcoalHoknj+thf8z1Ag==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-0/0.65.0/addcd9960885a1da5e67b13a45fa4619945049fc", + "integrity": "sha512-r8v/EbVIQpTrrlH18Gry/4S/yg6muvwNtLY1CctFJcPrEHniADZXr6Dwl79eagoYTUnPspavF+/ZW4Gs4LI67g==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-ns-json-schema-draft-4": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-ns-json-schema-draft-4": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" } }, "@swagger-api/apidom-ns-openapi-3-1": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-1/0.64.0/a52a069ddc54bbce8d859257ae0ec42dbb38d6b2", - "integrity": "sha512-B9eHLFtic1cflr8+7w985zAHctjnRCtxE1nOxHa26zfgCT73QqUJnyiCVsbnfr9SunHLffETXUSLjtFNjZOTVw==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-ns-openapi-3-1/0.65.0/634329302b7de4398f10a8f28c4d9e6e65d7118a", + "integrity": "sha512-0igHuPvcesdhRqDoRzm14q09eeBq0MVfYtaKg1fF0Vcl/nhxsm0iNUOHyXUE0s/b3nFhMYivCj62uNX+1OGhuw==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-ns-openapi-3-0": "^0.64.0", - "@types/ramda": "=0.28.20", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-ns-openapi-3-0": "^0.65.0", + "@types/ramda": "=0.28.21", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", "stampit": "=4.3.2" @@ -25070,16 +25073,16 @@ "integrity": "sha512-3HfneK3DGAm05fpyj20sT3apkNcvPpCuccOThOPdzz8sY7GgQGe0l93XH9bt+YzibcTIgUAIMoyVJI740RtgyQ==" }, "@swagger-api/apidom-reference": { - "version": "0.64.0", - "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-reference/0.64.0/3640b73d232c733ced93551c8b5ea47ab2ea3c3b", - "integrity": "sha512-dfdZ5SUmvOenpaukDFhH9RPH3ovt1W9mbvk5KMZlEwAGSzbnxbCPOlozPKIeLVPFPgH+vh/dJsCJE2MROHSReg==", + "version": "0.65.0", + "resolved": "https://npm.pkg.github.com/download/@swagger-api/apidom-reference/0.65.0/24535cb921141e0e97d553b4194477307096feab", + "integrity": "sha512-k8KZhQiG02xEtS5Mg/NT3x1u5/QVerSDWSp12lqIWK+oHhSVDDHj5G4fjAbPmoqlc17wicxpAcL9N+uUYvMSow==", "requires": { "@babel/runtime-corejs3": "=7.20.7", - "@swagger-api/apidom-core": "^0.64.0", - "@swagger-api/apidom-json-pointer": "^0.64.0", + "@swagger-api/apidom-core": "^0.65.0", + "@swagger-api/apidom-json-pointer": "^0.65.0", "@swagger-api/apidom-ns-asyncapi-2": "npm:-@0.0.1", - "@swagger-api/apidom-ns-openapi-3-0": "^0.64.0", - "@swagger-api/apidom-ns-openapi-3-1": "^0.64.0", + "@swagger-api/apidom-ns-openapi-3-0": "^0.65.0", + "@swagger-api/apidom-ns-openapi-3-1": "^0.65.0", "@swagger-api/apidom-parser-adapter-api-design-systems-json": "npm:-@0.0.1", "@swagger-api/apidom-parser-adapter-api-design-systems-yaml": "npm:-@0.0.1", "@swagger-api/apidom-parser-adapter-asyncapi-json-2": "npm:-@0.0.1", @@ -25090,9 +25093,9 @@ "@swagger-api/apidom-parser-adapter-openapi-yaml-3-0": "npm:-@0.0.1", "@swagger-api/apidom-parser-adapter-openapi-yaml-3-1": "npm:-@0.0.1", "@swagger-api/apidom-parser-adapter-yaml-1-2": "npm:-@0.0.1", - "@types/ramda": "=0.28.20", + "@types/ramda": "=0.28.21", "axios": "npm:-@0.0.1", - "minimatch": "=5.1.2", + "minimatch": "=6.1.5", "process": "=0.11.10", "ramda": "=0.28.0", "ramda-adjunct": "=3.4.0", @@ -25108,9 +25111,9 @@ } }, "minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-bNH9mmM9qsJ2X4r2Nat1B//1dJVcn3+iBLa3IgqJ7EbGaDNepL9QSHOxN4ng33s52VMMhhIfgCYDk3C4ZmlDAg==", + "version": "6.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-6.1.5.tgz", + "integrity": "sha512-2/WxnHMkH7qFS+pG8ibLN5GZdx5Y0aLlgFSghaKRUpkeEmC85wZRb/xDvj9jv601KdNOS2G/nNqj2h6k42yxBQ==", "requires": { "brace-expansion": "^2.0.1" } @@ -25295,9 +25298,9 @@ "dev": true }, "@types/ramda": { - "version": "0.28.20", - "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.28.20.tgz", - "integrity": "sha512-MeUhzGSXQTRsY19JGn5LIBTLxVEnyF6HDNr08KSJqybsm4DlfLIgK1jBHjhpiSyk252tXYmp+UOe0UFg0UiFsA==", + "version": "0.28.21", + "resolved": "https://registry.npmjs.org/@types/ramda/-/ramda-0.28.21.tgz", + "integrity": "sha512-yim1qtioaA304Px6eZ72WvE3D41+Ay696/VpSZ54VcY8DUZ6BCDbkE/Zvc0iudK8aXXXhEWV4opoKnlphxyRQw==", "requires": { "ts-toolbelt": "^6.15.1" } diff --git a/package.json b/package.json index 047cfdcedd..cc29a43d2a 100644 --- a/package.json +++ b/package.json @@ -111,10 +111,10 @@ }, "dependencies": { "@babel/runtime-corejs3": "^7.11.2", - "@swagger-api/apidom-core": "=0.64.0", - "@swagger-api/apidom-reference": "=0.64.0", - "@swagger-api/apidom-ns-openapi-3-1": "=0.64.0", - "@swagger-api/apidom-json-pointer": "=0.64.0", + "@swagger-api/apidom-core": "=0.65.0", + "@swagger-api/apidom-reference": "=0.65.0", + "@swagger-api/apidom-ns-openapi-3-1": "=0.65.0", + "@swagger-api/apidom-json-pointer": "=0.65.0", "cookie": "~0.5.0", "cross-fetch": "^3.1.5", "deepmerge": "~4.2.2", diff --git a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js index 9559067c5b..daf8166ecc 100644 --- a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js +++ b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js @@ -7,6 +7,7 @@ import openApi3_1Namespace, { getNodeType, keyMap } from '@swagger-api/apidom-ns import OpenApi3_1SwaggerClientDereferenceVisitor from './visitors/dereference.js'; import ParameterMacroVisitor from './visitors/parameters.js'; import ModelPropertyMacroVisitor from './visitors/properties.js'; +import AllOfVisitor from './visitors/all-of.js'; const visitAsync = visit[Symbol.for('nodejs.util.promisify.custom')]; @@ -16,18 +17,21 @@ const OpenApi3_1SwaggerClientDereferenceStrategy = OpenApi3_1DereferenceStrategy allowMetaPatches: false, parameterMacro: null, modelPropertyMacro: null, + mode: 'non-strict', }, init({ useCircularStructures = this.useCircularStructures, allowMetaPatches = this.allowMetaPatches, parameterMacro = this.parameterMacro, modelPropertyMacro = this.modelPropertyMacro, + mode = this.mode, } = {}) { this.name = 'openapi-3-1-swagger-client'; this.useCircularStructures = useCircularStructures; this.allowMetaPatches = allowMetaPatches; this.parameterMacro = parameterMacro; this.modelPropertyMacro = modelPropertyMacro; + this.mode = mode; }, methods: { async dereference(file, options) { @@ -70,6 +74,12 @@ const OpenApi3_1SwaggerClientDereferenceStrategy = OpenApi3_1DereferenceStrategy visitors.push(modelPropertyMacroVisitor); } + // create allOf visitor (if necessary) + if (this.mode !== 'strict') { + const allOfVisitor = AllOfVisitor(); + visitors.push(allOfVisitor); + } + // determine the root visitor const rootVisitor = visitors.length === 1 diff --git a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js new file mode 100644 index 0000000000..0e23bb7c60 --- /dev/null +++ b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js @@ -0,0 +1,63 @@ +import { isArrayElement, deepmerge } from '@swagger-api/apidom-core'; +import { isSchemaElement, SchemaElement } from '@swagger-api/apidom-ns-openapi-3-1'; + +const AllOfVisitor = () => ({ + SchemaElement: { + leave(schemaElement) { + // do nothing + if (typeof schemaElement.allOf === 'undefined') return undefined; + // throw if allOf keyword is not an array + if (!isArrayElement(schemaElement.allOf)) { + throw new TypeError('allOf must be an array'); + } + // remove allOf keyword if empty + if (schemaElement.allOf.isEmpty) { + return new SchemaElement( + schemaElement.content.filter((memberElement) => memberElement.key.toValue() !== 'allOf'), + schemaElement.meta.clone(), + schemaElement.attributes.clone() + ); + } + // throw if allOf keyword contains anything else than Schema Object + schemaElement.allOf.forEach((item) => { + if (!isSchemaElement(item)) { + throw new TypeError('Elements in allOf must be objects'); + } + }); + + const mergedSchemaElement = deepmerge.all([...schemaElement.allOf.content, schemaElement]); + + /** + * If there was not an original $$ref value, make sure to remove + * any $$ref value that may exist from the result of `allOf` merges. + */ + if (!schemaElement.hasKey('$$ref')) { + mergedSchemaElement.remove('$$ref'); + } + + /** + * If there was an example keyword in the original definition, + * keep it instead of merging with example from other schema. + */ + if (schemaElement.hasKey('example')) { + const member = mergedSchemaElement.getMember('example'); + member.value = schemaElement.get('example'); + } + + /** + * If there was an examples keyword in the original definition, + * keep it instead of merging with examples from other schema. + */ + if (schemaElement.hasKey('examples')) { + const member = mergedSchemaElement.getMember('examples'); + member.value = schemaElement.get('examples'); + } + + // remove allOf keyword after the merge + mergedSchemaElement.remove('allOf'); + return mergedSchemaElement; + }, + }, +}); + +export default AllOfVisitor; diff --git a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js index ac529a144c..9e9cfad673 100644 --- a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +++ b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js @@ -13,7 +13,7 @@ const ParameterMacroVisitor = ({ parameterMacro }) => { }, }, ParameterElement: { - leave: (parameterElement) => { + leave(parameterElement) { const pojoOperation = macroOperation === null ? null : toValue(macroOperation); const pojoParameter = toValue(parameterElement); const defaultValue = parameterMacro(pojoOperation, pojoParameter); diff --git a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js index f0f392ce7b..8d97209894 100644 --- a/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +++ b/src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js @@ -2,7 +2,7 @@ import { isObjectElement, toValue } from '@swagger-api/apidom-core'; const ModelPropertyMacroVisitor = ({ modelPropertyMacro }) => ({ SchemaElement: { - leave: (schemaElement) => { + leave(schemaElement) { if (typeof schemaElement.properties === 'undefined') return; if (!isObjectElement(schemaElement.properties)) return; diff --git a/src/resolver/strategies/openapi-3-1.js b/src/resolver/strategies/openapi-3-1.js index 5f95550ab5..82157ba99d 100644 --- a/src/resolver/strategies/openapi-3-1.js +++ b/src/resolver/strategies/openapi-3-1.js @@ -38,6 +38,7 @@ const resolveOpenAPI31Strategy = async (options) => { skipNormalization = false, parameterMacro = null, modelPropertyMacro = null, + mode = 'non-strict', } = options; try { // determining BaseURI @@ -101,6 +102,7 @@ const resolveOpenAPI31Strategy = async (options) => { useCircularStructures, parameterMacro, modelPropertyMacro, + mode, }), ], refSet, diff --git a/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/dereferenced.json b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/dereferenced.json index 6f9ffbff9a..453d4a6686 100644 --- a/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/dereferenced.json +++ b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/dereferenced.json @@ -13,6 +13,21 @@ }, "schema3": { "type": "object" + }, + "schema4": { + "type": "string" + }, + "Animal": { + "properties": { + "pet": { + "$$ref": "http://localhost:8123/root.json#/components/schemas/schema3", + "type": "object" + }, + "cat": { + "$$ref": "http://localhost:8123/root.json#/components/schemas/schema4", + "type": "string" + } + } } } } diff --git a/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/root.json b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/root.json index 3b107b785b..13ce2d4c03 100644 --- a/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/root.json +++ b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/__fixtures__/meta-patches-internal/root.json @@ -10,6 +10,19 @@ }, "schema3": { "type": "object" + }, + "schema4": { + "type": "string" + }, + "Animal": { + "properties": { + "pet": { + "$ref": "#/components/schemas/schema3" + }, + "cat": { + "$ref": "#/components/schemas/schema4" + } + } } } } diff --git a/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/all-of.js b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/all-of.js new file mode 100644 index 0000000000..56a667996b --- /dev/null +++ b/test/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/schema-object/all-of.js @@ -0,0 +1,872 @@ +/* eslint-disable camelcase */ +import { toValue } from '@swagger-api/apidom-core'; +import { mediaTypes, OpenApi3_1Element } from '@swagger-api/apidom-ns-openapi-3-1'; +import { + dereferenceApiDOM, + DereferenceError, +} from '@swagger-api/apidom-reference/configuration/empty'; + +import * as jestSetup from '../__utils__/jest.local.setup.js'; +import OpenApi3_1SwaggerClientDereferenceStrategy from '../../../../../../../../src/helpers/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js'; + +describe('dereference', () => { + beforeAll(() => { + jestSetup.beforeAll(); + }); + + afterAll(() => { + jestSetup.afterAll(); + }); + + describe('strategies', () => { + describe('openapi-3-1-swagger-client', () => { + describe('Schema Object', () => { + describe('given allOf is not an array', () => { + test('should throw error', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + allOf: {}, + }, + }, + }, + }); + const dereferenceThunk = () => + dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + await expect(dereferenceThunk()).rejects.toThrow(DereferenceError); + await expect(dereferenceThunk()).rejects.toMatchObject({ + cause: { + cause: { + message: expect.stringMatching(/^allOf must be an array$/), + }, + }, + }); + }); + }); + + describe('given allOf contains empty list', () => { + test('should remove the keyword from Schema Object', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + allOf: [], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + User: {}, + }, + }, + }); + }); + }); + + describe('give allOf contains non-object item', () => { + test('should throw error', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + allOf: [{ type: 'string' }, 2], + }, + }, + }, + }); + const dereferenceThunk = () => + dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + await expect(dereferenceThunk()).rejects.toThrow(DereferenceError); + await expect(dereferenceThunk()).rejects.toMatchObject({ + cause: { + cause: { + message: expect.stringMatching(/^Elements in allOf must be objects$/), + }, + }, + }); + }); + }); + + test('should resolve simple allOf', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + allOf: [{ type: 'string' }, { $id: 'urn:uuid:smartbear' }], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + User: { + type: 'string', + $id: 'urn:uuid:smartbear', + }, + }, + }, + }); + }); + + test('should resolve local references in allOf keyword', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + properties: {}, + allOf: [ + { $ref: '#/components/schemas/UserProfile' }, + { $id: 'urn:uuid:smartbear' }, + ], + }, + UserProfile: { + type: 'object', + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + User: { + properties: {}, + $id: 'urn:uuid:smartbear', + type: 'object', + }, + UserProfile: { + type: 'object', + }, + }, + }, + }); + }); + + test("shouldn't override properties of target Schema Object", async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + User: { + type: 'object', + allOf: [ + { type: 'string', customKeyword: 'val1' }, + { $id: 'urn:uuid:smartbear', customKeyword: 'val2' }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + User: { + type: 'object', + customKeyword: 'val2', + $id: 'urn:uuid:smartbear', + }, + }, + }, + }); + }); + + test('should retain $$ref meta patches', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + }, + Cat: { + allOf: [ + { $ref: '#/components/schemas/Pet' }, + { + type: 'object', + properties: { + meow: { + type: 'string', + }, + }, + }, + ], + }, + Animal: { + type: 'object', + properties: { + pet: { + $ref: '#/components/schemas/Pet', + }, + cat: { + $ref: '#/components/schemas/Cat', + }, + }, + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + dereference: { + strategies: [ + OpenApi3_1SwaggerClientDereferenceStrategy({ + allowMetaPatches: true, + }), + ], + }, + }); + + expect(toValue(dereferenced)).toMatchObject({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + }, + Cat: { + properties: { + meow: { + type: 'string', + }, + name: { + type: 'string', + }, + }, + type: 'object', + }, + Animal: { + type: 'object', + properties: { + pet: { + $$ref: expect.stringMatching(/#\/components\/schemas\/Pet$/), + properties: { + name: { + type: 'string', + }, + }, + type: 'object', + }, + cat: { + $$ref: expect.stringMatching(/#\/components\/schemas\/Cat$/), + properties: { + meow: { + type: 'string', + }, + name: { + type: 'string', + }, + }, + type: 'object', + }, + }, + }, + }, + }, + }); + }); + + test('should merge allOf items, deeply', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + Cat: { + allOf: [ + { properties: { cat: { type: 'object' } } }, + { properties: { cat: { type: 'string' } } }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + Cat: { + properties: { + cat: { + type: 'string', + }, + }, + }, + }, + }, + }); + }); + + test('should resolve nested allOf', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + Cat: { + allOf: [ + { + allOf: [{ type: 'string' }], + }, + { maximum: 1 }, + { + allOf: [ + { exclusiveMaximum: 2 }, + { + allOf: [{ minimum: 3 }, { exclusiveMinimum: 4 }], + }, + ], + }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + Cat: { + type: 'string', + maximum: 1, + exclusiveMaximum: 2, + minimum: 3, + exclusiveMinimum: 4, + }, + }, + }, + }); + }); + + test('should support nested allOfs with $refs', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + D: { + type: 'object', + properties: { + z: { + type: 'string', + description: 'Some Z string', + }, + }, + }, + C: { + type: 'object', + properties: { + d: { + title: 'D', + allOf: [ + { + description: 'Some D', + }, + { + $ref: '#/components/schemas/D', + }, + ], + }, + }, + }, + B: { + type: 'object', + properties: { + c: { + title: 'C', + allOf: [ + { + description: 'Some C', + }, + { + $ref: '#/components/schemas/C', + }, + ], + }, + }, + }, + A: { + type: 'object', + properties: { + b: { + title: 'B', + allOf: [ + { + $ref: '#/components/schemas/B', + }, + { + description: 'Some B', + }, + ], + }, + }, + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + D: { + type: 'object', + properties: { z: { type: 'string', description: 'Some Z string' } }, + }, + C: { + type: 'object', + properties: { + d: { + description: 'Some D', + type: 'object', + properties: { z: { type: 'string', description: 'Some Z string' } }, + title: 'D', + }, + }, + }, + B: { + type: 'object', + properties: { + c: { + description: 'Some C', + type: 'object', + properties: { + d: { + description: 'Some D', + type: 'object', + properties: { z: { type: 'string', description: 'Some Z string' } }, + title: 'D', + }, + }, + title: 'C', + }, + }, + }, + A: { + type: 'object', + properties: { + b: { + type: 'object', + properties: { + c: { + description: 'Some C', + type: 'object', + properties: { + d: { + description: 'Some D', + type: 'object', + properties: { z: { type: 'string', description: 'Some Z string' } }, + title: 'D', + }, + }, + title: 'C', + }, + }, + description: 'Some B', + title: 'B', + }, + }, + }, + }, + }, + }); + }); + + test('should deepmerge arrays inside of an `allOf`', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + one: { + allOf: [ + { + $ref: '#/components/schemas/two', + }, + { + type: 'object', + required: ['a', 'b'], + properties: { + nested: { + type: 'object', + required: ['e'], + }, + }, + }, + ], + }, + two: { + allOf: [ + { + type: 'object', + required: ['c', 'd'], + properties: { + nested: { + type: 'object', + required: ['f'], + }, + }, + }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + one: { + type: 'object', + required: ['c', 'd', 'a', 'b'], + properties: { + nested: { + type: 'object', + required: ['f', 'e'], + }, + }, + }, + two: { + type: 'object', + required: ['c', 'd'], + properties: { + nested: { + type: 'object', + required: ['f'], + }, + }, + }, + }, + }, + }); + }); + + test('should handle case, with an `allOf` referencing an `allOf`', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + one: { + allOf: [ + { + $ref: '#/components/schemas/two', + }, + { + type: 'object', + }, + ], + }, + two: { + allOf: [ + { + type: 'object', + }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + one: { + type: 'object', + }, + two: { + type: 'object', + }, + }, + }, + }); + }); + + test('should suppress merging example keyword', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + example: { + name: 'my pet', + }, + }, + Cat: { + allOf: [ + { $ref: '#/components/schemas/Pet' }, + { + type: 'object', + properties: { + meow: { + type: 'string', + }, + }, + example: { + name: 'my cat', + meow: 'meow', + }, + }, + ], + }, + PetCat: { + allOf: [ + { $ref: '#/components/schemas/Pet' }, + { $ref: '#/components/schemas/Cat' }, + ], + properties: { + id: { + type: 'string', + }, + }, + example: { + id: '1', + }, + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + example: { + name: 'my pet', + }, + }, + Cat: { + type: 'object', + properties: { + name: { + type: 'string', + }, + meow: { + type: 'string', + }, + }, + example: { + name: 'my cat', + meow: 'meow', + }, + }, + PetCat: { + type: 'object', + properties: { + id: { + type: 'string', + }, + name: { + type: 'string', + }, + meow: { + type: 'string', + }, + }, + example: { + id: '1', + }, + }, + }, + }, + }); + }); + + test('should suppress merging examples keyword', async () => { + const spec = OpenApi3_1Element.refract({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + examples: [ + { + name: 'my pet', + }, + ], + }, + Cat: { + allOf: [ + { $ref: '#/components/schemas/Pet' }, + { + type: 'object', + properties: { + meow: { + type: 'string', + }, + }, + examples: [ + { + name: 'my cat', + meow: 'meow', + }, + ], + }, + ], + }, + PetCat: { + allOf: [ + { $ref: '#/components/schemas/Pet' }, + { $ref: '#/components/schemas/Cat' }, + ], + properties: { + id: { + type: 'string', + }, + }, + examples: [ + { + id: '1', + }, + ], + }, + }, + }, + }); + const dereferenced = await dereferenceApiDOM(spec, { + parse: { mediaType: mediaTypes.latest('json') }, + }); + + expect(toValue(dereferenced)).toEqual({ + openapi: '3.1.0', + components: { + schemas: { + Pet: { + type: 'object', + properties: { + name: { + type: 'string', + }, + }, + examples: [ + { + name: 'my pet', + }, + ], + }, + Cat: { + type: 'object', + properties: { + name: { + type: 'string', + }, + meow: { + type: 'string', + }, + }, + examples: [ + { + name: 'my pet', + }, + { + name: 'my cat', + meow: 'meow', + }, + ], + }, + PetCat: { + type: 'object', + properties: { + id: { + type: 'string', + }, + name: { + type: 'string', + }, + meow: { + type: 'string', + }, + }, + examples: [ + { + id: '1', + }, + ], + }, + }, + }, + }); + }); + }); + }); + }); +}); +/* eslint-enable camelcase */ diff --git a/test/specmap/all-of.js b/test/specmap/all-of.js index 08a71a7900..97b25d15eb 100644 --- a/test/specmap/all-of.js +++ b/test/specmap/all-of.js @@ -61,8 +61,12 @@ describe('allOf', () => { allOf: [ { original: 'no', + subOriginal: 'no1', notOriginal: 'yes', }, + { + subOriginal: 'no2', + }, ], }, plugins: [plugins.refs, plugins.allOf], @@ -71,6 +75,7 @@ describe('allOf', () => { errors: [], spec: { original: 'yes', + subOriginal: 'no2', notOriginal: 'yes', }, });