[x3d-public] Follow up, ticket to expand conversion code into JSON validator (pure Java).

John Carlson yottzumm at gmail.com
Thu Feb 17 01:57:27 PST 2022


We don't need a JSON Schema validator to validate JSON documents when we
have X3DJSONLD.java and X3DJSAIL:

See:

https://sourceforge.net/p/x3d/tickets/18/

You may use the code with the Apache 2.0 license. I have already given you
the rights to use X3DJSONLD.java, and you suggested that you would rename
the file, which is OK!

I'm not seeing other dependencies beyond JDK (JSON library?)

So can we drop X3D JSON schema, except for X3DJSONLD website?

Anyone skilled at creating Java validators (which all the Java examples
that I know of in the X3D examples archives are) should be able to craft
this code into a JSON validator.   I don't know how to do ant/build.xml
that well.  I can help with the Java, but I would direct you do any Java
example in the archive as an example of a validator, a snippet included
below from Hello, World:

		X3DJSONLD loader = new X3DJSONLD();
		JsonObject jsobj = loader.readJsonFile(new
File("examples/HelloWorldProgramOutput.json"));
		Document document = loader.loadJsonIntoDocument(jsobj);
		X3DLoaderDOM  xmlLoader = new X3DLoaderDOM();
		X3D X3D0 = (X3D)xmlLoader.toX3dModelInstance(document);

		String validationResults = X3D0.validationReport();
                if (validationResults.startsWith("\n")) {
                        System.out.println();
			System.out.println(validationResults.trim());
		}


I'm hopefully going to leave the rest of the details to you (passing
command line args), but I will help as needed!


No more bitching about "No JSON schema draft," please!


John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220217/0d42ff7d/attachment.html>


More information about the x3d-public mailing list