[x3d-public] JSON validation

Andreas Plesch andreasplesch at gmail.com
Wed Feb 15 20:33:43 PST 2017


If just the JSON itself needs to be validated, jsonlint already accepts
URLs as a parameter:

http://jsonlint.com/?json=http%3A%2F%2Fwww.web3d.org%2Fx3d%2Fcontent%2Fexamples%2FBasic%2Fdevelopment%2FSchemaTest.json

leads to a validation. Might be useful for trickier cases (escaping,
quoting ..) . The colon and forward slashes should be easy to replace in
any example URL.

This of course does not take into account a x3d schema.

Andreas

On Feb 15, 2017 9:06 PM, <x3d-public-

Date: Wed, 15 Feb 2017 17:31:50 -0800
From: Don Brutzman <brutzman at nps.edu>
To: <yottzumm at gmail.com>
Cc: X3D Graphics public mailing list <x3d-public at web3d.org>
Subject: Re: [x3d-public] ClassCastException in X3DJSAIL. Probably
        okay, since it's a test program.
Message-ID: <bb83585f-9890-9871-8c3b-de990f24ca7d at nps.edu>
Content-Type: text/plain; charset="utf-8"; format=flowed

... mm, can you figure out a way to link a scene url into a json validator
url?  for example, something that combines

        http://jsonlint.com/
with
        http://www.web3d.org/x3d/content/examples/Basic/
development/SchemaTest.json

if so, i can add such validation-convenience links to each index page in
the archives...



------------------------------

Message: 3
Date: Wed, 15 Feb 2017 21:05:28 -0500
From: <yottzumm at gmail.com>
To: Don Brutzman <brutzman at nps.edu>
Cc: X3D Graphics public mailing list <x3d-public at web3d.org>
Subject: Re: [x3d-public] ClassCastException in X3DJSAIL. Probably
        okay, since it's a testprogram.
Message-ID: <58a508e8.a3116b0a.b5f88.ba11 at mx.google.com>
Content-Type: text/plain; charset="utf-8"

Likely there?s an easy reason.  Sorry I haven?t had more opportunity to
look at this.  I am working on something else.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Wednesday, February 15, 2017 8:32 PM
To: yottzumm at gmail.com
Cc: X3D Graphics public mailing list
Subject: Re: ClassCastException in X3DJSAIL. Probably okay, since it's a
testprogram.

please send .java program, TIA

am guessing that maybe you didn't use setMetadata method on Appearance? two
forms are available:

        http://www.web3d.org/specifications/java/javadoc/
org/web3d/x3d/jsail/Shape/AppearanceObject.html#
setMetadata-org.web3d.x3d.sai.Core.X3DMetadataObject-

        http://www.web3d.org/specifications/java/javadoc/
org/web3d/x3d/jsail/Shape/AppearanceObject.html#setMetadata-org.web3d.x3d.
jsail.Core.ProtoInstanceObject-

On 2/15/2017 4:41 PM, yottzumm at gmail.com wrote:
> www.web3d.org/x3d/content/examples/Basic/development/SchemaTest.json

or, more likely from scene head/meta information:

{

     "@name": "description",
     "@content": "Test scene for obscure schema validation cases."

},
{

     "@name": "error",
     "@content": "Test scene that does not render or validate."

},

        http://www.web3d.org/x3d/content/examples/Basic/
development/SchemaTestIndex.html

X3D validator finds many things wrong:

        https://savage.nps.edu/X3dValidator?url=http://www.
web3d.org/x3d/content/examples/Basic/development/SchemaTest.x3d

hmm, can you figure out a way to link a scene url into a json validator
url?  for example, something that combines

        http://jsonlint.com/
with
        http://www.web3d.org/x3d/content/examples/Basic/
development/SchemaTest.json

if so, i can add such validation-convenience links to each index page in
the archives...


> java.lang.ClassCastException: org.web3d.x3d.jsail.Core.MetadataIntegerObject
cannot be cast to org.web3d.x3d.sai.Core.X3DNode^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.getValue(
MetadataSetObject.java:427)^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(
MetadataSetObject.java:1102)^M
>
>         at org.web3d.x3d.jsail.Shape.AppearanceObject.validate(
AppearanceObject.java:1630)^M
>
>         at org.web3d.x3d.jsail.Shape.ShapeObject.validate(
ShapeObject.java:1153)^M
>
>         at org.web3d.x3d.jsail.Core.SceneObject.validate(
SceneObject.java:522)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.
java:1603)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(
X3DObject.java:725)^M
>
>         at www_web3d_org.x3d.content.examples.Basic.development.
SchemaTest.main(SchemaTest.java:262)^M
>
> Exception in thread "main" java.lang.ClassCastException:
org.web3d.x3d.jsail.Core.MetadataIntegerObject cannot be cast to
org.web3d.x3d.sai.Core.X3DNode^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.getValue(
MetadataSetObject.java:427)^M
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(
MetadataSetObject.java:1102)^M
>
>         at org.web3d.x3d.jsail.Shape.AppearanceObject.validate(
AppearanceObject.java:1630)^M
>
>         at org.web3d.x3d.jsail.Shape.ShapeObject.validate(
ShapeObject.java:1153)^M
>
>         at org.web3d.x3d.jsail.Core.SceneObject.validate(
SceneObject.java:522)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.
java:1603)^M
>
>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(
X3DObject.java:725)^M
>
>         at www_web3d_org.x3d.content.examples.Basic.development.
SchemaTest.main(SchemaTest.java:262)^M

all the best, Don
--
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/
attachments/20170215/b84e67cb/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SchemaTest.java
Type: application/octet-stream
Size: 12820 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/
attachments/20170215/b84e67cb/attachment.obj>

------------------------------

Subject: Digest Footer

_______________________________________________
x3d-public mailing list
x3d-public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org


------------------------------

End of x3d-public Digest, Vol 95, Issue 32
******************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170215/1b5d8a58/attachment-0001.html>


More information about the x3d-public mailing list