[x3d-public] renewed development of X3D JSON support

John Carlson yottzumm at gmail.com
Tue Oct 12 00:39:25 PDT 2021


I note a few things with the converted JSON schema.

fields with a leading - (like children, I guess) are not present.

There are few constraints from X3DUOM to include, min/max field values, 
number of items in an array.

There's no real @geoSystem constraint checking (perhaps intentional).

Perhaps the leading . or ..  is similar to the leading -   IDK

oneOf is not used for schema alternatives?  Instead perhaps numbers are 
used to provide differences??? looks like a LOT of bloat.

Size is 70% larger than my current X3D4 JSON schema.

Comments are not supported AFAICT.

Overall it looks like a good start, I'm just worried about more code 
bloat after more constraints are added.

prefixItems is not used at all in the the schema.  This is an important 
concept when your arrays contain differently typed items.

I hope you can get XMLSpy to work better.  What I will do is put the 
converted schema through my validator.

I'm making headway on the 2020-12 schema generation, but I ran into a 
wall, see below.  I think X3DUOM may need to change to support the efforts.


=============================================================================================

Here's my currrent progress.  Note that all examples are under oneOf.  
So oneOf might not be well supported by Ajv 8 or 2020-12. I'll have to 
check.  I'll look for a way to disable strict mode to proceed.

$ node validatex3djson.js 
/c/x3d-code/www.web3d.org/x3d/content/examples/HelloWorld.json 2>&1 |sort -u
strict mode: "prefixItems" is 10-tuple, but minItems or maxItems/items 
are not specified or different at path 
"#/oneOf/1/properties/%40crossSection"
strict mode: "prefixItems" is 16-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40matrix"
strict mode: "prefixItems" is 2-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/0"
strict mode: "prefixItems" is 2-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/1"
strict mode: "prefixItems" is 2-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40type"
strict mode: "prefixItems" is 3-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40avatarSize"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/2"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/3"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/4"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/5"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/6"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/$defs/@geoSystem/oneOf/7"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path 
"#/oneOf/1/properties/%40clipBoundary"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40fieldOfView"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path 
"#/oneOf/1/properties/%40jointBindingRotations"
strict mode: "prefixItems" is 4-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40orientation"
strict mode: "prefixItems" is 6-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40spine"
strict mode: "prefixItems" is 9-tuple, but minItems or maxItems/items 
are not specified or different at path "#/oneOf/1/properties/%40inertia"





More information about the x3d-public mailing list