<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Apologies that this comes in the middle of the holidays!</div><div><br></div><div>Don, tread with care when applying the ProtoInstance.name being a required change.</div><div><br></div><div>I don't plan to apply the change to x3dvalidate until the end of February for those who are relying on it.  I still need to test changes in X3DJSONLD.  This is an advance warning!</div><div><br></div><div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 29, 2024 at 8:05 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Don, thanks for responding.</div><div dir="auto"><br></div><div dir="auto">1.  I will try to make name required in ProtoInstance, pending your changes to validation.</div></blockquote><div dir="auto"><br></div><div dir="auto">Upon review, it looks like there are errors in not requiring @name in both ProtoInstance subschemas of X3D JSON schema 4.0.  What I did was make ProtoInstance's field /name/ have use="required" in X3DUOM, V4.0.  I don't know what will happen with X3D 3.0-3.3 yet.  Initial changes indicated that @name is required with nodes without @USE.  I made changes to the python to accommodate the ProtoInstance @USE subschema, requiring both @USE and @name for X3D V4.0.</div><div dir="auto"><br></div><div>Original X3D JSON schema 4.0:</div><div dir="auto"><br></div><div dir="auto">  "ProtoInstance": {<br>      "type": "object",<br>      "oneOf": [<br>        {<br>          "type": "object",<br>          "properties": {<br>            "@class": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@name": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@USE": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "-children": {<br>              "type": "array",<br>              "minItems": 1,<br>              "items": {<br>                "type": "object",<br>                "properties": {<br>                  "#comment": {<br>                    "type": "string",<br>                    "$comment": "#comment statements are the only allowed in -children node when using a USE field"<br>                  }<br>                },<br>                "additionalProperties": false<br>              }<br>            }<br>          },<br><font color="#ff0000">          "required": [<br>            "@USE"<br>          ],</font><br>          "additionalProperties": false<br>        },<br>        {<br>          "type": "object",<br>          "properties": {<br>            "-children": {<br>              "type": "array",<br>              "minItems": 1,<br>              "items": {<br>                "type": "object",<br>                "properties": {<br>                  "#comment": {<br>                    "type": "string"<br>                  }<br>                },<br>                "additionalProperties": false<br>              }<br>            },<br>            "fieldValue": {<br>              "$ref": "#/$defs/fieldValue"<br>            },<br>            "IS": {<br>              "$ref": "#/$defs/IS"<br>            },<br>            "-metadata": {<br>              "$ref": "#/$defs/-X3DMetadataObjectSFNode"<br>            },<br>            "@name": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@DEF": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@class": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@id": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@style": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            }<br>          },<br>          "additionalProperties": false<br>        }<br>      ]<br>    },</div><div dir="auto"><br></div><div>Here's the new result (Only for X3D V4.0, I will have to edit the python to include other versions).  Note that @name is now *required* in all cases, even if @USE is provided.</div><div><br></div><div><br></div><div>    "ProtoInstance": {<br>      "type": "object",<br>      "oneOf": [<br>        {<br>          "type": "object",<br>          "properties": {<br>            "@class": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@name": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@USE": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "-children": {<br>              "type": "array",<br>              "minItems": 1,<br>              "items": {<br>                "type": "object",<br>                "properties": {<br>                  "#comment": {<br>                    "type": "string",<br>                    "$comment": "#comment statements are the only allowed in -children node when using a USE field"<br>                  }<br>                },<br>                "additionalProperties": false<br>              }<br>            }<br>          },<br><font color="#ff0000">          "required": [<br>            "@name",<br>            "@USE"<br>          ],</font><br>          "additionalProperties": false<br>        },<br>        {<br>          "type": "object",<br>          "properties": {<br>            "-children": {<br>              "type": "array",<br>              "minItems": 1,<br>              "items": {<br>                "type": "object",<br>                "properties": {<br>                  "#comment": {<br>                    "type": "string"<br>                  }<br>                },<br>                "additionalProperties": false<br>              }<br>            },<br>            "fieldValue": {<br>              "$ref": "#/$defs/fieldValue"<br>            },<br>            "IS": {<br>              "$ref": "#/$defs/IS"<br>            },<br>            "-metadata": {<br>              "$ref": "#/$defs/-X3DMetadataObjectSFNode"<br>            },<br>            "@name": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@DEF": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@class": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@id": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            },<br>            "@style": {<br>              "$comment": "SFString inputOutput",<br>              "type": "string"<br>            }<br>          },<br><font color="#ff0000">          "required": [<br>            "@name"<br>          ],</font><br>          "additionalProperties": false<br>        }<br>      ]<br>    },<br></div><div><br></div><div>Since this change is a breaking change, and may invalidate some X3D JSON files, I will wait an amount of time before I implement this change in my repositories, realizing that I may need to check my code in due to a service call on my machine.  I suggested *not* upgrading x3dvalidate and X3DJSONLD until you've had a chance to test your JSON.</div><div><br></div><div>Thanks,</div><div><br></div><div>John</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"></div></blockquote></div></div>
</div>
</div>
</div>