[x3d-public] Follow-up. Changes to X3D JSON schema for NavigationInfo.type validation

John Carlson yottzumm at gmail.com
Sat Jan 22 00:49:54 PST 2022


I believe the array of enums was duplicated because there are 2 default
values.  But don't quote me on that, I haven't checked the standard at this
point.

John

On Sat, Jan 22, 2022 at 2:30 AM John Carlson <yottzumm at gmail.com> wrote:

> Here are changes to X3D JSON schema to support NavigationInfo.type as a
> JSON string and not as a JSON array.
>
> Note that we lose quite a bit of validation power, essentially, the user
> can specify *any* string--essentially there is no validation beyond JSON
> type.  This is because of the combinatorial aspect that the user can
> specify in an MFString--any ordering of the enum values is allowed. But I'm
> not really sure if we didn't already support *any* string.  I'm unsure at
> this point whether we have a pattern for NavigationInfo.type.  I checked,
> and it doesn't look useful.
>
> I'm also wondering why the array of enums in the old schema was nearly
> duplicated.
>
> None of this is checked in yet.   It's your opportunity to comment.  I
> will follow with changes to the schema generator.
>
> Thanks,
>
> John
>
>
> diff --git a/src/main/schema/x3d-3.0-JSONSchema.json
> b/src/main/schema/x3d-3.0-JSONSchema.json
> index 3cfcc8f91..059a81858 100644
> --- a/src/main/schema/x3d-3.0-JSONSchema.json
> +++ b/src/main/schema/x3d-3.0-JSONSchema.json
> @@ -9002,38 +9002,7 @@
>              },
>              "@type": {
>                "$comment": "MFString inputOutput",
> -              "type": "array",
> -              "prefixItems": [
> -                {
> -                  "enum": [
> -                    "ANY",
> -                    "WALK",
> -                    "EXAMINE",
> -                    "FLY",
> -                    "LOOKAT",
> -                    "NONE",
> -                    "EXPLORE"
> -                  ],
> -                  "default": "EXAMINE",
> -                  "type": "string"
> -                },
> -                {
> -                  "enum": [
> -                    "ANY",
> -                    "WALK",
> -                    "EXAMINE",
> -                    "FLY",
> -                    "LOOKAT",
> -                    "NONE",
> -                    "EXPLORE"
> -                  ],
> -                  "default": "ANY",
> -                  "type": "string"
> -                }
> -              ],
> -              "items": {
> -                "type": "string"
> -              }
> +              "type": "string"
>              },
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220122/d0840c6b/attachment-0001.html>


More information about the x3d-public mailing list