Upgrade from 6.5.3 to 6.6.0 breaks generation
See original GitHub issueJust run Orval generation
Error compiling schema, function code: const schema19 = scope.schema[13];const schema20 = scope.schema[14];const pattern0 = scope.pattern[0];return function validate17(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;const _errs0 = errors;let valid0 = true;const _errs1 = errors;if(!(Array.isArray(data))){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}var _valid0 = _errs1 === errors;errors = _errs0;if(vErrors !== null){if(_errs0){vErrors.length = _errs0;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs3 = errors;if(Array.isArray(data)){if(data.length < 1){const err1 = {instancePath,schemaPath:"#/then/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}const len0 = data.length;for(let i0=0; i0<len0; i0++){let data0 = data[i0];if(typeof data0 === "string"){if(!pattern0.test(data0)){const err2 = {instancePath:instancePath+"/" + i0,schemaPath:"path-expression/pattern",keyword:"pattern",params:{pattern: "^[$#]"},message:"must match pattern \""+"^[$#]"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/" + i0,schemaPath:"path-expression/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(errors > 0){for(const err4 of vErrors){if((((({"str":"err4"}.keyword !== "errorMessage") && (!{"str":"err4"}.emUsed)) && (({"str":"err4"}.instancePath === instancePath+{"_items":["\"/\" + ",{"str":"i0"},""]}) || (({"str":"err4"}.instancePath.indexOf(instancePath+{"_items":["\"/\" + ",{"str":"i0"},""]}) === 0) && ({"str":"err4"}.instancePath[instancePath+{"_items":["\"/\" + ",{"str":"i0"},""]}.length] === "/")))) && ({"str":"err4"}.schemaPath.indexOf("path-expression") === 0)) && ({"str":"err4"}.schemaPath["path-expression".length] === "/")){{"str":"emErrs0"}.push({"str":"err4"});{"str":"err4"}.emUsed = true;}}if({"str":"emErrs0"}.length){if(vErrors === null){vErrors = [{"str":"err5"}];}else {vErrors.push({"str":"err5"});}errors++;}const emErrs1 = [];for(const err6 of vErrors){if(!{"str":"err6"}.emUsed){{"str":"emErrs1"}.push({"str":"err6"});}}vErrors = emErrs1;errors = {"str":"emErrs1"}.length;}}}else {const err7 = {instancePath,schemaPath:"#/then/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(errors > 0){const emErrors0 = {"minItems":[]};for(const err8 of vErrors){if(((((({"str":"err8"}.keyword !== "errorMessage") && (!{"str":"err8"}.emUsed)) && ({"str":"err8"}.instancePath === instancePath)) && ({"str":"err8"}.keyword in {"str":"emErrors0"})) && ({"str":"err8"}.schemaPath.indexOf("#/then") === 0)) && (/^\/[^\/]*$/.test({"str":"err8"}.schemaPath.slice(6)))){{"str":"emErrors0"}[{"str":"err8"}.keyword].push({"str":"err8"});{"str":"err8"}.emUsed = true;}}for(const key0 in emErrors0){if({"str":"emErrors0"}[{"str":"key0"}].length){if(vErrors === null){vErrors = [{"str":"err9"}];}else {vErrors.push({"str":"err9"});}errors++;}}const emErrs2 = [];for(const err10 of vErrors){if(!{"str":"err10"}.emUsed){{"str":"emErrs2"}.push({"str":"err10"});}}vErrors = emErrs2;errors = {"str":"emErrs2"}.length;}var _valid0 = _errs3 === errors;valid0 = _valid0;ifClause0 = "then";}else {const _errs8 = errors;if(typeof data === "string"){if(!pattern0.test(data)){const err11 = {instancePath,schemaPath:"path-expression/pattern",keyword:"pattern",params:{pattern: "^[$#]"},message:"must match pattern \""+"^[$#]"+"\""};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath,schemaPath:"path-expression/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(errors > 0){for(const err13 of vErrors){if((((({"str":"err13"}.keyword !== "errorMessage") && (!{"str":"err13"}.emUsed)) && (({"str":"err13"}.instancePath === instancePath) || (({"str":"err13"}.instancePath.indexOf(instancePath) === 0) && ({"str":"err13"}.instancePath[instancePath.length] === "/")))) && ({"str":"err13"}.schemaPath.indexOf("path-expression") === 0)) && ({"str":"err13"}.schemaPath["path-expression".length] === "/")){{"str":"emErrs3"}.push({"str":"err13"});{"str":"err13"}.emUsed = true;}}if({"str":"emErrs3"}.length){if(vErrors === null){vErrors = [{"str":"err14"}];}else {vErrors.push({"str":"err14"});}errors++;}const emErrs4 = [];for(const err15 of vErrors){if(!{"str":"err15"}.emUsed){{"str":"emErrs4"}.push({"str":"err15"});}}vErrors = emErrs4;errors = {"str":"emErrs4"}.length;}var _valid0 = _errs8 === errors;valid0 = _valid0;ifClause0 = "else";}if(!valid0){const err16 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate17.errors = vErrors;return errors === 0;}
/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/index.js:120
throw e;
^
SyntaxError: Unexpected token ':'
at new Function (<anonymous>)
at Ajv.compileSchema (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/index.js:89:30)
at Ajv.inlineOrCompile (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/index.js:148:47)
at Ajv.resolveRef (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/index.js:142:46)
at Object.code (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/vocabularies/core/ref.js:19:47)
at keywordCode (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/validate/index.js:454:13)
at /Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/validate/index.js:185:25
at CodeGen.code (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/codegen/index.js:439:13)
at CodeGen.block (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/codegen/index.js:568:18)
at schemaKeywords (/Users/user/dev/project/node_modules/@stoplight/spectral-core/node_modules/ajv/dist/compile/validate/index.js:185:13)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Upgrade from older OCCT versions - Open CASCADE ...
Upgrade to OCCT 6.5.3. Porting of user applications from an earlier OCCT version to version 6.5.3 requires taking into account the following major...
Read more >VMware ESXi 6.5 Update 3 Release Notes
This issue is resolved in this release. The fix restores the network connectivity after the filter creation. PR 2260907: vSphere Web Client becomes...
Read more >Cisco Firepower Release Notes, Version 6.6 - Upgrade the ...
You can upgrade directly to Version 6.6 as follows. If you are patching Version 6.6, note that patches change the fourth digit only....
Read more >How to easily update your VMware vCenter Server Appliance ...
At a minimum, do a snapshot (or backup) of this VCSA VM before upgrading, then make sure everything works alright after the upgrade,...
Read more >About upgrading to 9.0 READ THIS FIRST
Follow the guidance for these critical items to avoid breaking your existing installation during an upgrade. Splunk Enterprise 9.0.2 changes the default value ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Unfortunately, deleting the yarn.lock file does not work in my case with the latest version of Orval (6.9.6) using a OpenAPI spec that is validated correctly.
The only way to fix it is
yarn add ajv
, which should not be needed imo. Can this issue be re-opened @anymaniax ?Using: node 16.17.0 npm 8.15.0 yarn 1.22.19 orval 6.9.6 (latest version as of writing this comment)
Error:
I deleted the yarn.lock and recreate it and it works now. I think I had a previous version still locked