[x3d-public] X3D JSON Schema warnings and validation automation progress
John Carlson
yottzumm at gmail.com
Sat Mar 26 19:15:07 PDT 2016
Cool. Good work Don. I reported earlier that schema validation was integrated into my X3D JSON Loader, if you don’t want to have to bother with uploading a schema. http://coderextreme.net/X3DJSONLD/ <http://coderextreme.net/X3DJSONLD/> Recent additions include adding encoding and version from JSON to XML. I currently use the Ajv schema validation suite which reports different errors than json-schema-validator.
John
> On Mar 26, 2016, at 9:39 PM, Don Brutzman <brutzman at nps.edu> wrote:
>
> 1. jslint balks at the current x3d-3.3-JSONSchema.json as follows. These errors can be silenced using the --white command-line switch. Your call
>
> http://happygiraffe.github.io/jslint4java/cli.html
>
> First check X3D JSON Schema
> ..error checking with jslint
> jslint:../../specifications/x3d-3.3-JSONSchema.json:2:1:Use spaces, not tabs.
> jslint: jslint.options=white: No such file or directory.
> jslint:../../specifications/x3d-3.3-JSONSchema.json:3:1:Use spaces, not tabs.
> jslint:../../specifications/x3d-3.3-JSONSchema.json:4:1:Use spaces, not tabs.
> jslint:../../specifications/x3d-3.3-JSONSchema.json:5:1:Use spaces, not tabs.
> jslint:../../specifications/x3d-3.3-JSONSchema.json:6:1:Use spaces, not tabs.
> [...]
> jslint:../../specifications/x3d-3.3-JSONSchema.json:51:1:Too many errors. (0% scanned).
> Java Result: 1
>
> ==========================================================================
>
> 2. I haven't figured out how to invoke jshint (likely using Java Rhino) but online checker reports no issues with your 17,575 lines of JSON source.
>
> http://jshint.com
>
> ==========================================================================
>
> 3. JSON Schema Validator has no problems, either checking the schema by itself or checking HelloWorld.json.
>
> https://github.com/fge/json-schema-validator
>
> $ java -jar json-schema-validator-2.2.6-lib.jar ../../../../../specifications/x3d-3.3-JSONSchema.json ../HelloWorld.json
> --- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\HelloWorld.json---
> validation: SUCCESS
> --- END C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\HelloWorld.json---
>
> $ java -jar json-schema-validator-2.2.6-lib.jar ../../../../../specifications/x3d-3.3-JSONSchema.json ../HelloWorld.json
> --- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\HelloWorld.json---
> validation: SUCCESS
> --- END C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\HelloWorld.json---
>
> ==========================================================================
>
> 4. jslint and json-schema-validator checking of both X3D JSON Schema and JSON test examples has been added to the x3d stylesheets project, invoked from the build.xml target test.X3dToJson.xslt as follows.
>
> ant -f C:\\x3d-code\\www.web3d.org\\x3d\\stylesheets test.X3dToJson.xslt
> test.mkdir:
> test.X3dToJson.xslt:
> =====================================
> First check X3D JSON Schema:
> ..error checking with jslint
> ..error checking with json-schema-validator
> --- BEGIN C:\x3d-code\www.web3d.org\specifications\x3d-3.3-JSONSchema.json---
> validation: SUCCESS
> --- END C:\x3d-code\www.web3d.org\specifications\x3d-3.3-JSONSchema.json---
> =====================================
> ... etc
> ==========================================================================
>
> 5. This X3D JSON Schema validation is also now integrated into the full examples build when converting .x3d scenes to .json. Regression testing in progress, will post results later.
>
> all the best, Don
> --
> Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
> Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160326/da0b5e72/attachment.html>
More information about the x3d-public
mailing list