[x3d-public] draft-07 and X3D JSON schema validation.

John Carlson yottzumm at gmail.com
Sat Apr 10 18:19:55 PDT 2021


I think that Ajv has a way to validate JSON schema draft-07 and all the 
versions of the X3D JSON schema.

While this probably shouldn't run on every X3D JSON file, I will 
probably create a separate script or scripts for inclusion in a larger 
generation or validation test suite.

I already have an Everit Java-based version of this in x3dschema. 
Unfortunately, the java code does not print anything upon success, and 
exceptions will be thrown from main().

What I'd like to do is validate the JSON schema (draft-07) and X3D JSON 
generated schemas with a python-based validator for now.


From: https://json-schema.org/implementations.html#validator-python :

  * jsonschema <https://github.com/Julian/jsonschema> /draft-07, -06,
    -04, -03 / (MIT)
  * fastjsonschema <https://github.com/horejsek/python-fastjsonschema>
    /draft-07, -06, -04 / Great performance thanks to code generation.
    (BSD-3-Clause)
  * jsonschema-rs <https://github.com/Stranger6667/jsonschema-rs/python>
    /draft-07, -06, -04 / Python bindings to Rust’s jsonschema crate (MIT)

These validations will added to the 
X3DJSONLD/src/main/python/generateSchemas.py Python3 script, as best as 
I can manage.


Note:  In generateSchema.py, there's also jsonlint, which pretty-prints 
and parses the X3D JSON schemas, so there's no need to accomplish that.  
We will validate each schema generated after generation (obviously, not 
before).  We will validate draft-07 before the loop.

John

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210410/29b6d446/attachment.html>


More information about the x3d-public mailing list