chromium/tools/json_schema_compiler/test/json_basics.json

[
  {
    "namespace": "fakeJson",
    "description": "Fake JSON API Stuff",
    "types": [
      {
        "id": "CrazyEnum",
        "type": "string",
        "enum": [
          "camelCaseEnum",
          "Non-Characters",
          "5NumFirst",
          "3Just-plainOld_MEAN"
        ]
      },
      {
        "id": "CrazyObject",
        "type": "object",
        "additionalProperties": {
          "type": "string"
        }
      },
      {
        "id": "ArraySimple",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      {
        "id": "ArrayOfInlineObject",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "name": {"type": "string" },
            "value": {"type": "string", "optional": true },
            "binaryValue": {
              "type": "array",
              "optional": true,
              "items": {"type": "integer"}
            }
          }
        }
      },
      {
        "id": "TwoChoices",
        "choices": [
          { "type": "binary" },
          { "type": "string" }
        ]
      }
    ],
    "properties": {
      "lastError": {
        "type": "string",
        "description": "The lastError."
      }
    },
    "functions": [
      {
        "name": "funcWithInlineObj",
        "type": "function",
        "parameters": [
          {
            "type": "object",
            "name": "inlineObj",
            "description": "Evil inline object! With a super duper duper long string description that causes problems!",
            "properties": {
              "foo": {
                "type": "boolean",
                "optional": "true",
                "description": "The foo."
              },
              "bar": {
                "type": "integer",
                "description": "The bar."
              },
              "baz": {
                "type": "object",
                "description": "Inception object.",
                "properties": {
                  "depth": {
                    "type": "integer"
                  }
                }
              },
              "quu": {
                "type": "binary",
                "description": "The array buffer"
              }
            }
          },
          {
            "name": "callback",
            "type": "function",
            "parameters": [
              {
                "type": "object",
                "name": "returnObj",
                "properties": {
                  "str": {
                    "type": "string"
                  }
                }
              }
            ],
            "description": "The callback to this heinous method"
          }
        ],
        "returns": {
          "type": "object",
          "properties": {
            "str": {
              "type": "string"
            },
            "int": {
              "type": "number"
            }
          }
        }
      },
      {
        "name": "funcWithReturnsAsync",
        "type": "function",
        "parameters": [
          {
            "type": "integer",
            "name": "someNumber",
            "description": "A number parameter"
          }
        ],
        "returns_async": {
          "name": "callback",
          "optional": true,
          "parameters": [
            {
              "name": "anotherNumber",
              "type": "integer",
              "description": "A number that comes back"
            }
          ]
        }
      }
    ]
  }
]