[x3d-public] JSON validation: X3D json schema issues

Don Brutzman brutzman at nps.edu
Mon Mar 6 16:58:43 PST 2017


Roy and John, apparently there is still a problem with this scene, according to X3D JSON validation.

http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json

==================
Excerpt .x3d

<IMPORT AS='someInlineRoot' importedDEF='someName' inlineDEF='someInline'/>

==================
Excerpt .json

"IMPORT": [
   {
	"@AS":"someInlineRoot",
	"@importedDEF":"someName",
	"@inlineDEF":"someInline"
   }
]

==================
Diagnostic using json schema:

--- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\X3dSpecifications\X3dHeaderPrototypeSyntaxExamples.json---
validation: FAILURE
[ {
   "level" : "error",
   "schema" : {
     "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json#",
     "pointer" : "/definitions/Scene"
   },
   "instance" : {
     "pointer" : "/X3D/Scene"
   },
   "domain" : "validation",
   "keyword" : "additionalProperties",
   "message" : "object instance has properties which are not allowed by the schema: [\"IMPORT\"]",
   "unwanted" : [ "IMPORT" ]
} ]
--- END C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\X3dSpecifications\X3dHeaderPrototypeSyntaxExamples.json---

Not sure what the problem is.  Since IMPORT attributes seem OK, perhaps the last "message" is saying that IMPORT is not an allowed child of Scene?  If so, that is an incorrect validation error that should be fixed.

Am seeing a similar problem with JSON validation of a Metadata* node at top level within Scene:

C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/3DPrinting//MetadataRootNodeTest.json error checking with json-schema-validator
--- BEGIN C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\3DPrinting\MetadataRootNodeTest.json---
validation: FAILURE
[ {
   "level" : "error",
   "schema" : {
     "loadingURI" : "file:/C:/x3d-code/www.web3d.org/specifications/x3d-3.3-JSONSchema.json#",
     "pointer" : "/definitions/Scene"
   },
   "instance" : {
     "pointer" : "/X3D/Scene"
   },
   "domain" : "validation",
   "keyword" : "additionalProperties",
   "message" : "object instance has properties which are not allowed by the schema: [\"-metadata\"]",
   "unwanted" : [ "-metadata" ]
} ]
--- END C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling\3DPrinting\MetadataRootNodeTest.json---


BTW, checked the JSONLint FAQ but apparently that tool does not yet support json schema validation, no way found to invoke it.  Am getting this json diagnostic error while using Java invocation of json-schema-validator v2.2.6.

	https://github.com/fge/json-schema-validator

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