{
  "$schema": "https://flow.jig.md/schemas/schema-1.json",
  "title": "Jig project authoring value/1",
  "oneOf": [
    {
      "$ref": "#/$defs/project"
    },
    {
      "$ref": "#/$defs/bindingDefinition"
    }
  ],
  "$defs": {
    "localName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "projectPath": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "discoverSource": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "discover"
        },
        "roots": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/projectPath"
          },
          "minItems": 1,
          "maxItems": 65536
        }
      },
      "required": [
        "kind",
        "roots"
      ],
      "additionalProperties": false
    },
    "membersSource": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "members"
        },
        "paths": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/projectPath"
          },
          "maxItems": 65536
        }
      },
      "required": [
        "kind",
        "paths"
      ],
      "additionalProperties": false
    },
    "source": {
      "oneOf": [
        {
          "$ref": "#/$defs/discoverSource"
        },
        {
          "$ref": "#/$defs/membersSource"
        }
      ]
    },
    "project": {
      "type": "object",
      "properties": {
        "flows": {
          "$ref": "#/$defs/source"
        },
        "bindings": {
          "$ref": "#/$defs/source"
        }
      },
      "additionalProperties": false
    },
    "packageBinding": {
      "type": "object",
      "properties": {
        "kind": {
          "const": "package"
        },
        "package": {
          "$ref": "#/$defs/projectPath"
        },
        "settings": {
          "type": "object",
          "maxProperties": 65536
        }
      },
      "required": [
        "kind",
        "package",
        "settings"
      ],
      "additionalProperties": false
    },
    "bindingDefinition": {
      "$ref": "#/$defs/packageBinding"
    }
  }
}
