Thursday 4 July 2013

How to give comment on Json file

 "_comment" : "comment text goes here...",
The JSON should all be data, and if you include a comment, then it will be data too.

You could have a designated data element called "_comment" (or something) that would be ignored by apps that use the json data.

You would probably be better having the comment in the processes that generate/receive the json, as they are supposed to know what the json data will be in advance, or at least the structure of it.

But if you decided to...

1 comment:

  1. {
    "description": "Any validation failures are shown in the right-hand Messages pane.",
    "type": "object",
    "properties": {
    "foo": {
    "type": "number"
    },
    "bar": {
    "type": "string",
    "enum": [
    "a",
    "b",
    "c"
    ]
    }
    }
    }

    ReplyDelete