Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      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

        Activity

        Hide
        github-import GitHub Import added a comment -

        [Date: Wed Feb 26 00:48:09 CET 2014, Author: julianhyde]

        I implemented it as suggested. The fact that it is non-standard JSON is not a concern. If anyone doesn't want to use comments, no one is forcing them to.

        Show
        github-import GitHub Import added a comment - [Date: Wed Feb 26 00:48:09 CET 2014, Author: julianhyde ] I implemented it as suggested. The fact that it is non-standard JSON is not a concern. If anyone doesn't want to use comments, no one is forcing them to.

          People

          • Assignee:
            Unassigned
            Reporter:
            github-import GitHub Import
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development