[X3D-Ecosystem] JSON good in the archives, more on JSON linting
John Carlson
yottzumm at gmail.com
Sun Jan 4 11:34:28 PST 2026
To support Don, he’s confident in the archive because, likely:
* XML schema validation is done
* Castle tools do validation of VRML and XML
* X3DJSAIL does validation of XML
* JSON is created from XML
There’s no guarantee that your own JSON with just ordinary jsonlint,
linter, or JSON.parse() will be secure. If your source documents are JSON,
watch out! Even @prantlf/jsonlint without schema could be problematic!
One critical thing to do in JavaScript is .hasOwnProperty() for your
properties, so you don’t get prototype properties as well. There’s no
guarantee someone won’t try to overwrite your array or string length with
data.
Do you have to trust your schema or API? Yes! That’s why I suggest using
XML schema to validate X3D JSON! It’s a trade-off between creating DOM
from JSON and using a JSON schema.
>From my brain type, I realize that I’m not trustworthy to people! That
doesn’t mean I don’t try to be correct.
I would further encourage Don to add node type name and attribute name
testing to X3dTo*.xslt if he hasn’t already done so, because I just use
stylesheets without validation! I realize that X3DJSAIL is the solution!
Getting there!
I’m kind of realizing that much of glTF doesn’t use class/types names,
preferring enums, AFAIK. Perhaps this is why!
John
On Sun, Jan 4, 2026 at 12:39 PM John Carlson <yottzumm at gmail.com> wrote:
> I would love to contribute to the JSON standard now that I am a member
> again. I just don’t know about my wordsmithing skills, so people will have
> to improve what I write.
>
> The feature I am showing in @prantlf/jsonlint is the ability to use JSON
> schema. Other jsonlint’s I am aware of do not use JSON schema, so they are
> simply like JSON.parse() in JavaScript with error reporting. What this
> means is if you have a node that isn’t an X3D node in JSON, no error will
> be reported, possibly leading to constructors that weren’t meant to be
> called, like Function, to name a potentially dangerous one. Recent code
> related to Maya was revealed to access globals() to construct a class.
>
> This is why JSON Schema, XML schema (on JSON), a factory pattern, a set of
> node names to check against, an API like X_ITE, X3DOM, X3DJSAIL or Castle
> is of upmost concern, in mildly conservative cases. APIs can have a wide
> variety of treatment, with eval being common in some, it’s not wise to just
> use a linter.
>
> I welcome Altova XMLSpy and Liquid XML. OxygenXML might be another. Some
> have more means than others. XML schema can be employed for those who
> can’t afford a commercial schema and don’t want to use my JSON schema. I
> recommend web3d invest in the XML schema solution for JSON documents before
> proceeding with JSON Schema, realizing JSON schema has things that XML
> schema doesn’t and vica versa. I have also investigated other XML schema
> to JSON schema solutions, and X3D JSON appears to be a special case.
>
> There’s no problem with just typing constructors hardcoded in your Java
> code, that’s validated by the compiler/interpreter. The problem is
> treating data like code.
>
> Thanks,
>
> John
>
> On Sun, Jan 4, 2026 at 11:30 AM Don Brutzman <don.brutzman at gmail.com>
> wrote:
>
>> First off, for clarity, there is no official X3D JSON Schema yet.
>>
>> Next, the X3D Example Archives provide a jsonlint link via jsonlint.com
>> for each of the models. For instance,
>>
>> - X3D Example Archives: X3D4WA, X3D for Web Authors, Chapter 03
>> Grouping, Group Animated
>> - Example for Group node, with animated color for the Sphere
>> -
>> https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/GroupAnimatedIndex.html
>> - " .json
>> <https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/GroupAnimated.json>
>> (check
>> <https://jsonlint.com/?url=https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/GroupAnimated.json>
>> ) " (see blue highlight in image)
>> -
>> https://jsonlint.com/?url=https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter03Grouping/GroupAnimated.json
>> - " JSON is valid! "
>>
>> [image: image.png]
>>
>> The build scripts for the example archives also use
>>
>> - Google Code Archive: jslint4java
>> - https://code.google.com/archive/p/jslint4java/
>> - example console output:
>>
>> C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors/Chapter03Grouping//GroupAnimated.json
>>> validation checking with jslint
>>> C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors/Chapter03Grouping//GroupAnimated.json
>>> validation checking with json-schema-validator
>>> ... does not support latest JSON Schema, this test is not yet usable
>>
>>
>> So I think we have good coverage of jsonlint for the examples archive.
>>
>> Our best description for how to use X3D JSON can be found at
>>
>> - *X3D to JSON Stylesheet Converter*
>> - The X3D to JSON stylesheet converts .x3d XML to .json, supporting
>> the forthcoming JSON Encoding for X3D Graphics.
>> - https://www.web3d.org/x3d/stylesheets/X3dToJson.html
>>
>> Next, looking ahead: later this year am expecting we will look at
>> updating and autogenerating the X3D JSON Schema from X3DUOM using best
>> practices. Although JSON Schema was never standardized via IETF RFC, usage
>> seems fairly common these days. This can be an informative annex in
>> upcoming X3D JSON Encoding ISO/IEC 19776-5:202x specification. Using
>> x3d-public mailing list, am expecting we will have at least three design
>> patterns to consider:
>>
>> 1. your best effort for JSON schema
>> 2. Altova XMLSpy, XML schema converted to JSON schema
>> 3. Liquid XML, XML schema converted to JSON schema
>> 4. any other design patterns that are offered
>>
>> It certainly will be interesting to have an X3D JSON draft standard and
>> some recommendable form of X3D JSON validation available. Thanks for
>> leading the way in this direction.
>>
>> Have fun with X3D JSON! 😀
>>
>> all the best, Don
>> --
>> X3D Graphics, Maritime Robotics, Distributed Simulation
>> Relative Motion Consulting https://RelativeMotion.info
>>
>>
>> On Sun, Jan 4, 2026 at 6:39 AM John Carlson via X3D-Ecosystem <
>> x3d-ecosystem at web3d.org> wrote:
>>
>>> If you use jsonlint to validate JSON, you may get this error:
>>>
>>> echo "{}" | jsonlint -V x3d-4.0-JSONSchema.json -e draft-2020-12
>>>
>>> File: <stdin>
>>> Loading the JSON Schema failed:
>>> Compiling the JSON Schema failed.
>>> strict mode: unknown keyword: "x-orderOf"
>>>
>>>
>>> I have just become aware of this.
>>>
>>>
>>> X3dvalidate avoids this by passing { strict: false } to the Ajv2020 constructor.
>>>
>>>
>>> So your choices are use x3dvalidate, modify the schema, or modify jsonlint.
>>>
>>>
>>> If someone wants me to do a pull request for jsonlint, I can look into it, but I feel the ajv-formats2019 will need to be added as well.
>>>
>>>
>>> As the x-orderOf is non-functional, I can also remove it.
>>>
>>>
>>> John
>>>
>>> --
>>> X3D-Ecosystem mailing list
>>> X3D-Ecosystem at web3d.org
>>> http://web3d.org/mailman/listinfo/x3d-ecosystem_web3d.org
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20260104/44784374/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 118513 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20260104/44784374/attachment-0001.png>
More information about the X3D-Ecosystem
mailing list