{
  "title": "Join Table DataSource",
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema",
  "description": "Join Table data source is the result of a join operation. Nested joins are supported. To use nested joins, set either leftTableSource or rightTableSource to be a joinTable.",
  "properties": {
    "joinType": {
      "type": "string",
      "description": "The type of join (left outer or left inner).",
      "enum": [
        "esriLeftInnerJoin",
        "esriLeftOuterJoin"
      ]
    },
    "leftTableKey": {
      "type": "string",
      "description": "Field name from the left table."
    },
    "leftTableSource": {
      "type": "object",
      "description": "The left source. If the leftTableSource is a table, the resulting joinTable is a table. If the leftTableSource is a layer, the resulting joinTable is a layer.",
      "$ref": "source_schema.json"
    },
    "rightTableKey": {
      "type": "string",
      "description": "Field name from the right table."
    },
    "rightTableSource": {
      "type": "object",
      "description": "The right table source.",
      "$ref": "source_schema.json"
    },
    "type": {
      "type": "string",
      "description": "String value indicating the type for the dataSource.",
      "enum": [
        "joinTable"
      ]
    }
  },
  "required": [
    "type"
  ],
  "additionalProperties": false,
  "esriDocumentation": {
    "examples": [
      {
        "title": "Join Table DataSource",
        "code": {
          "dataSource": {
            "type": "joinTable",
            "leftTableSource": {
              "type": "mapLayer",
              "mapLayerId": 0
            },
            "rightTableSource": {
              "type": "dataLayer",
              "dataSource": {
                "type": "table",
                "workspaceId": "MAP",
                "dataSourceName": "MAP.user1.TaxLots",
                "gdbVersion": "MAP.Version1"
              }
            },
            "leftTableKey": "STATE_FIPS",
            "rightTableKey": "FIPS",
            "joinType": "esriLeftOuterJoin"
          }
        }
      }
    ]
  }
}
