[x3d-public] Replacing USE with DEF

John Carlson yottzumm at gmail.com
Fri Mar 27 18:21:46 PDT 2026


Cool, I just learned another way to use JSON schema:

json

{
  "type": "object",
  "properties": {
    "propertyA": { "type": "string" },
    "propertyB": { "type": "string" }
  },
  "oneOf": [
    {
      "required": ["propertyA"]
    },
    {
      "required": ["propertyB"]
    },
    {
      "not": {
        "anyOf": [
          { "required": ["propertyA"] },
          { "required": ["propertyB"] }
        ]
      }
    }
  ],
  "additionalProperties": false
}


Note that JSON schema is very good at distinguishing SFNode and MFNode.
XML schema, probably not so hot.  Feel free to catch SFNode versus MFNode
in XML schema, so I don’t have to deal with the issues.

John

On Fri, Mar 27, 2026 at 8:07 PM John Carlson <yottzumm at gmail.com> wrote:

> Replacing USE with DEF would massively improve the JSON schema.   I vote
> for that!   It would massively improve the error reporting as well.
>
> What does FreeWRL think?
>
> No need for two attributes for the same meaning.
>
> USE and DEF code be used interchangeably, and container fields could
> specify parents.
>
> The only problem I see is when USE and DEF are used together, but that’s
> already an issue.
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20260327/9dadd7f6/attachment.html>


More information about the x3d-public mailing list