haryp2309 / json-type-checker

0 stars 0 forks source link

Support for custom types #1

Closed haryp2309 closed 7 months ago

haryp2309 commented 7 months ago

Add a new optional keyword define for each node that allows for defining a new non-standard type.

Example of how .typedef.json will look:

{
    "type": "object",
    "properties": {
      "jobs": {
        "type": "list",
        "children": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "command": {
              "type": "string"
            },
            "tag": {
              "type": "string"
            },
            "run_id": {
              "type": "number"
            }
          }
        }
      }
    },
    "define": {
      "person": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string"
          },
          "friend": {
            "type": "person"
          }
        }
      }
    }
  }