[x3d-public] Encoding of MFString fields in JSON (.x3dj)

Holger Seelig holger.seelig at yahoo.de
Mon Aug 28 07:36:58 PDT 2023


There is currently an open issue about JSON encoding of MFString fields, especially the NavigationInfo.type field: https://github.com/create3000/x_ite/issues/146

All MFString fields should be encoded the same way: as you can see in https://www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/NavigationInfo/speed_scaling.json
ImageTexture and Script.url fields are encoded as JSON Array of Strings, but NavigationInfo.type is encoded as simple string with strange contents: https://www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/NavigationInfo/any_type.json.

No professional programmer would seriously use another encoding for NavigationInfo.type, then the other MFString values have. The encoding used for NavigationInfo.type is only useful if you are going to convert the JSON to XML, which is probably not what you want when you parse a JSON. An Array of String follows the same encoding scheme as the other types like MFInt32 (Array of Integers), which is very convenient.

I don't really like to change anything about the encoding of JSON in X_ITE.

Best regards,
Holger

--
Holger Seelig
Leipzig, Germany

holger.seelig at yahoo.de
https://create3000.github.io/x_ite/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230828/cdceff9a/attachment.html>


More information about the x3d-public mailing list