[x3d-public] X3D JSON Schema warnings and validation automation progress

Don Brutzman brutzman at nps.edu
Sat Mar 26 18:39:51 PDT 2016


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



More information about the x3d-public mailing list