<div dir="auto">This looks like how to support older versions of JSON schema with current Ajv:</div><div dir="auto"><br></div><div dir="auto"><div><a href="https://github.com/ajv-validator/ajv-formats">https://github.com/ajv-validator/ajv-formats</a></div><div dir="auto"><br></div><div dir="auto">I will work on installing this in my packages.</div><div dir="auto"><br></div><div dir="auto">John</div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 7, 2021 at 11:03 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">The new version 8 of ajv appears to support draft 07 by adding a schema <br>
to Ajv2019 class instance, but I tried with the Ajv class instance, and <br>
it didn't work.<br>
<br>
<a href="https://ajv.js.org/guide/schema-language.html" rel="noreferrer" target="_blank">https://ajv.js.org/guide/schema-language.html</a><br>
<br>
describes how to use draft07 with Ajv2019.<br>
<br>
So if anyone wants to attempt to use draft 07 with the latest Ajv, that <br>
would be cool.<br>
<br>
The main problem appears to be "uri"<br>
<br>
Here are the changed I tried:<br>
<br>
<br>
~/x3dvalidate$ git diff .<br>
diff --git a/index.js b/index.js<br>
index 6deeccb..e3b5bb1 100644<br>
--- a/index.js<br>
+++ b/index.js<br>
@@ -1,5 +1,7 @@<br>
  "use strict";<br>
-var Ajv = require('ajv');<br>
+var Ajv = require('ajv/dist/2019');^M<br>
+const draft7MetaSchema = require("ajv/dist/refs/json-schema-draft-07.json")<br>
+<br>
  var fs = require('fs');<br>
  var http = require('http');<br>
  var jsonlint = require('jsonlint');<br>
@@ -82,6 +84,7 @@ function loadSchema(json, file, doValidate, success, <br>
failure, language) {<br>
                 console.error("Adding meta schema");<br>
                 ajv.addMetaSchema(metaschemajson);<br>
                 */<br>
+               ajv.addMetaSchema(draft7MetaSchema)<br>
                 console.error("Loading schema");<br>
                 var schema = <br>
fs.readFileSync("x3d-"+version+"-JSONSchema.json");<br>
                 console.error("Parsing schema");<br>
<br>
<br>
Thanks,<br>
<br>
John<br>
<br>
On 5/7/21 9:50 PM, John Carlson wrote:<br>
> This seems to work in x3dvalidate <br>
> <a href="https://github.com/coderextreme/x3dvalidate" rel="noreferrer" target="_blank">https://github.com/coderextreme/x3dvalidate</a><br>
><br>
> ~/x3dvalidate$ cat package.json<br>
> {<br>
>   "name": "x3dvalidate",<br>
>   "version": "1.0.0",<br>
>   "private": true,<br>
>   "dependencies": {<br>
>     "ajv": "^6.12.6",<br>
>     "ajv-i18n": "^3.6.0",<br>
>     "jsonlint": "<a href="https://github.com/prantlf/jsonlint.git" rel="noreferrer" target="_blank">https://github.com/prantlf/jsonlint.git</a>"<br>
>   }<br>
> }<br>
><br>
><br>
> I am going with an old version of ajv which still supports draft 07 <br>
> because the latest does not recognize "uri"<br>
><br>
> Best of luck, I will work on upgrading X3DJSONLD and pythonSAI next.<br>
><br>
><br>
> John<br>
><br>
> On 5/7/21 9:20 PM, John Carlson wrote:<br>
>> The main issue appears to be that jsonlint is out of date with <br>
>> current packages (nomnom has been withdrawn).  If someone works on a <br>
>> fix for this, that would be great.<br>
>><br>
>> It appears that some people are using:<br>
>><br>
>> "@gerhobbelt/nomnom": "^1.8.4-27"<br>
>><br>
>> <a href="https://github.com/zaach/jsonlint/pull/120/files" rel="noreferrer" target="_blank">https://github.com/zaach/jsonlint/pull/120/files</a><br>
>><br>
>> This was not obvious until I got to x3dvalidate.<br>
>><br>
>> I don't know how to override the nomnom package in package.json or <br>
>> package-lock.json<br>
>><br>
>> Help would be appreciated!<br>
>><br>
>> On 5/7/21 8:34 PM, John Carlson wrote:<br>
>>> $ grep -l underscore */package-lock.json<br>
>>> pc.multiplayer/package-lock.json<br>
>>> pythonSAI/package-lock.json<br>
>>> X3DJSONLD/package-lock.json<br>
>>> x3droundtrip/package-lock.json<br>
>>> x3dvalidate/package-lock.json<br>
>>><br>
</blockquote></div></div>