diff --git a/package-lock.json b/package-lock.json index 3c9f52d2c14..80c38e10df2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,7 +24,7 @@ "@oclif/core": "^1.26.2", "@oclif/errors": "^1.3.6", "@oclif/plugin-not-found": "^2.3.22", - "@smoya/multi-parser": "^3.0.0", + "@smoya/multi-parser": "^4.0.0", "@stoplight/spectral-cli": "6.9.0", "ajv": "^8.12.0", "chalk": "^4.1.0", @@ -747,6 +747,19 @@ "semver": "bin/semver" } }, + "node_modules/@asyncapi/generator/node_modules/@smoya/multi-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@smoya/multi-parser/-/multi-parser-3.0.0.tgz", + "integrity": "sha512-HtA/Png8FQ2vwiKKMSOqNkYGERUFqieeekwtuMsImmgnaiacyq97itehbep179qO/TvHb+3luRZAJ433fHgIxg==", + "dependencies": { + "@asyncapi/avro-schema-parser": "^3.0.3", + "@asyncapi/openapi-schema-parser": "^3.0.4", + "@asyncapi/protobuf-schema-parser": "^3.0.0", + "@asyncapi/raml-dt-schema-parser": "^4.0.4", + "parserv2": "npm:@asyncapi/parser@^2.1.0", + "parserv3": "npm:@asyncapi/parser@^2.2.0-next-major-spec.2" + } + }, "node_modules/@asyncapi/generator/node_modules/argparse": { "version": "1.0.10", "license": "MIT", @@ -797,6 +810,55 @@ } } }, + "node_modules/@asyncapi/generator/node_modules/parserv3": { + "name": "@asyncapi/parser", + "version": "2.2.0-next-major-spec.2", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-2.2.0-next-major-spec.2.tgz", + "integrity": "sha512-KkS+sPCHFFPZrFzzx4UGiYDrDfJI583AksLFg6QUKwr5Wjq8o7cIC3Hel2ptaRVv5x1nJz0o6QzFeY7VIWCc1g==", + "dependencies": { + "@asyncapi/specs": "^6.0.0-next-major-spec.6", + "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", + "@stoplight/json-ref-resolver": "^3.1.5", + "@stoplight/spectral-core": "^1.16.1", + "@stoplight/spectral-functions": "^1.7.2", + "@stoplight/spectral-parsers": "^1.0.2", + "@types/json-schema": "^7.0.11", + "@types/urijs": "^1.19.19", + "ajv": "^8.11.0", + "ajv-errors": "^3.0.0", + "ajv-formats": "^2.1.1", + "avsc": "^5.7.5", + "js-yaml": "^4.1.0", + "jsonpath-plus": "^7.2.0", + "node-fetch": "2.6.7", + "ramldt2jsonschema": "^1.2.3", + "webapi-parser": "^0.5.0" + } + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/@asyncapi/specs": { + "version": "6.0.0-next-major-spec.8", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.0.0-next-major-spec.8.tgz", + "integrity": "sha512-WVhzeJepkqO6abDprz9bk9zR/ESidanQncPP7jFRUJQ71ED4/XQMjaSKLE5MB09eUUZoY5EqoccUQJWfc54SMg==", + "dependencies": { + "@types/json-schema": "^7.0.11" + } + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "node_modules/@asyncapi/generator/node_modules/parserv3/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/@asyncapi/generator/node_modules/react": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", @@ -5459,16 +5521,16 @@ } }, "node_modules/@smoya/multi-parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@smoya/multi-parser/-/multi-parser-3.0.0.tgz", - "integrity": "sha512-HtA/Png8FQ2vwiKKMSOqNkYGERUFqieeekwtuMsImmgnaiacyq97itehbep179qO/TvHb+3luRZAJ433fHgIxg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@smoya/multi-parser/-/multi-parser-4.0.0.tgz", + "integrity": "sha512-NgPxSaB3YqwrIVe7AtQ/wh9I2J0BHR4lP0PdqirYYrc0XXRwdDjIRrywEc2jjECWsL7tuGU/QtGMGIVaJe6ZYA==", "dependencies": { "@asyncapi/avro-schema-parser": "^3.0.3", "@asyncapi/openapi-schema-parser": "^3.0.4", "@asyncapi/protobuf-schema-parser": "^3.0.0", "@asyncapi/raml-dt-schema-parser": "^4.0.4", "parserv2": "npm:@asyncapi/parser@^2.1.0", - "parserv3": "npm:@asyncapi/parser@^2.2.0-next-major-spec.2" + "parserv3": "npm:@asyncapi/parser@^3.0.0-next-major-spec.3" } }, "node_modules/@stoplight/better-ajv-errors": { @@ -15267,9 +15329,9 @@ }, "node_modules/parserv3": { "name": "@asyncapi/parser", - "version": "2.2.0-next-major-spec.2", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-2.2.0-next-major-spec.2.tgz", - "integrity": "sha512-KkS+sPCHFFPZrFzzx4UGiYDrDfJI583AksLFg6QUKwr5Wjq8o7cIC3Hel2ptaRVv5x1nJz0o6QzFeY7VIWCc1g==", + "version": "3.0.0-next-major-spec.3", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.0-next-major-spec.3.tgz", + "integrity": "sha512-LCrAQqJpGxraMyU2k1Nh1X6Q1dz7a/YhTRRFFrQHOEo+TUT/kRdoUkRDP++e58dO7h9MBN+/hZK5TaqE+/jQiw==", "dependencies": { "@asyncapi/specs": "^6.0.0-next-major-spec.6", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", diff --git a/package.json b/package.json index 4043b580f4c..5eaeb71a410 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "@oclif/core": "^1.26.2", "@oclif/errors": "^1.3.6", "@oclif/plugin-not-found": "^2.3.22", - "@smoya/multi-parser": "^3.0.0", + "@smoya/multi-parser": "^4.0.0", "@stoplight/spectral-cli": "6.9.0", "ajv": "^8.12.0", "chalk": "^4.1.0", diff --git a/src/commands/generate/models.ts b/src/commands/generate/models.ts index 211b5ed8054..e75a0e1de23 100644 --- a/src/commands/generate/models.ts +++ b/src/commands/generate/models.ts @@ -164,9 +164,9 @@ export default class Models extends Command { } // Modelina, atm, is not using @asyncapi/parser@v3.x but @asyncapi/parser@v2.x, so it still uses Parser-API v1.0.0. - // This call converts the parsed document object using @asyncapi/parser@v3.x (Parser-API v2.0.0) to a document compatible with the Parser-API version in use in @asyncapi/parser@v2.x (v1.0.0) + // This call converts the parsed document object using @asyncapi/parser@v3.x (Parser-API v2) to a document compatible with the Parser-API version in use in @asyncapi/parser@v2.x (v1) // This is needed until https://github.com/asyncapi/modelina/issues/1493 gets fixed. - const convertedDoc = ConvertDocumentParserAPIVersion(document.json(), '1.0.0'); + const convertedDoc = ConvertDocumentParserAPIVersion(document.json(), 1); Logger.setLogger({ info: (message) => {