Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
What about allowing comments in the JSON schema? May prove useful as schemata get more complex.
Pro
- documented schema
Con
- non-standard JSON
Alternative
- pseudo-element, e.g. _comment: "..."
- redefine hack: (see: http://fadefade.com/json-comments.html )
It's possible to redefine Javascript object attributes:
> Object.keys(JSON.parse(' {"a": 1, "a": 2}')).length;
=> 1;
So you can do this:
"favorite_numbers": "An array containing my all-time favorite numbers",
"favorite_numbers": [19, 13, 53]
It looks like standard javascript comments could be enabled here:
net/hydromatic/optiq/model/ModelHandler.java(54)
by setting the ALLOW_COMMENTS flag.
---------------- Imported from GitHub ----------------
Url: https://github.com/julianhyde/optiq/issues/160
Created by: HenryOlson
Labels:
Created at: Tue Feb 25 22:23:20 CET 2014
State: closed