{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Transitland Datastore Changeset",
  "type": "object",
  "properties": {
    "changes": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": ["action"],
        "oneOf": [
          {
            "required": ["stop"],
            "properties": {
              "stop": {
                "$ref": "./stop.json"
              }
            }
          },
          {
            "required": ["operator"],
            "properties": {
              "operator": {
                "$ref": "./operator.json"
              }
            }
          },
          {
            "required": ["route"],
            "properties": {
              "route": {
                "$ref": "./route.json"
              }
            }
          }
        ],
        "properties": {
          "action": {
            "type": { "enum": ["createUpdate", "destroy"] }
          }
        }
      }
    },
    "whenToApply": {
      "type": { "enum": ["holdForReview", "instantlyIfClean"] }
    }
  }
}

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Transitland Datastore Changeset",
  "type": "object",
  "properties": {
    "changes": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "required": ["action"],
        "oneOf": [
          {
            "required": ["stop"],
            "properties": {
              "stop": {
                "$ref": "./stop.json"
              }
            }
          },
          {
            "required": ["operator"],
            "properties": {
              "operator": {
                "$ref": "./operator.json"
              }
            }
          },
          {
            "required": ["route"],
            "properties": {
              "route": {
                "$ref": "./route.json"
              }
            }
          },
					{
						"required": ["schedule_stop_pair"]
					}
        ],
        "properties": {
          "action": {
            "type": { "enum": ["createUpdate", "destroy"] }
          }
        }
      }
    },
    "whenToApply": {
      "type": { "enum": ["holdForReview", "instantlyIfClean"] }
    }
  }
}

Allow schedule_stop_pair in Changeset Schema
Allow schedule_stop_pair in Changeset Schema

TODO: schedule_stop_pair JSON schema
