{
	"$schema": "http://json-schema.org/draft-07/schema",
	"title": "Connector JSON Schema",
	"description": "connector.json file included in all EPS connectors",
	"type": "object",
	"properties": {
		"name": {
			"description": "Name of Connector",
			"type": "string",
			"pattern": "^[\\w \\-]*$",
			"maxLength": 29
		},
		"version": {
			"description": "Connector version",
			"type": "string"
		},
		"__tableau-version": {
			"description": "Minimum required Tableau version",
			"type": "object",
			"properties": {
				"min": {
					"description": "Minimum version of Tableau supported",
					"type": "string"
				},
				"max" : {
					"description": "Maximum version of Tableau supported",
					"type": "string"
				}
			}
		},
		"tableau-version": {
			"type": "object",
			"properties": {
				"min": {
					"description": "Minimum supported Tableau version",
					"type": "string",
					"maxLength": 256
				},
				"max": {
					"description": "Maximum supported Tableau version",
					"type": "string",
					"maxLength": 256
				}
			},
			"required": [
				"min",
				"max"
			]
		},
		"vendor": {
			"type": "object",
			"properties": {
				"name": {
					"description": "Creator name/title",
					"type": "string",
					"maxLength": 256
				},
				"support-link": {
					"description": "Support link for connector",
					"type": "string",
					"maxLength": 256
				},
				"email": {
					"description": "Contact email for connector",
					"type": "string",
					"maxLength": 256
				}
			},
			"required": [
				"name",
				"support-link",
				"email"
			]
		},
		"auth": {
			"type": "object",
			"properties": {
				"type": {
					"description": "The type of authentication, e.g. basic, oauth2, etc.",
					"type": "string",
					"maxLength": 256
				},
				"oauth": {
					"type": "object",
					"properties": {
						"clientIdDesktop": {
							"description": "Client ID you registered for Tableau Desktop",
							"type": "string",
							"maxLength": 256
						},
						"clientSecretDesktop": {
							"description": "Client secret you registered for Tableau Desktop",
							"type": "string",
							"maxLength": 256
						},
						"redirectUrisDesktop": {
							"description": "Redirect URIs for Desktop",
							"type": "array"
						},
						"authUri": {
							"description": "Authorization endpoint URI",
							"type": "string",
							"maxLength": 256
						},
						"tokenUri": {
							"description": "Token endpoint URI",
							"type": "string",
							"maxLength": 256
						},
						"userInfoUri": {
							"description": "User Info endpoint URI",
							"type": "string",
							"maxLength": 256
						},
						"scopes": {
							"description": "Scopes",
							"type": "array"
						},
						"capabilities": {
							"description": "Defines how OAuth flow behaves",
							"type": "object",
							"properties": {
								"OAUTH_CAP_SUPPORTS_CUSTOM_DOMAIN": {
									"type": "boolean"
								},
								"OAUTH_CAP_REQUIRE_PKCE": {
									"type": "boolean"
								},
								"OAUTH_CAP_PKCE_REQUIRES_CODE_CHALLENGE_METHOD": {
									"type": "boolean"
								},
								"OAUTH_CAP_SUPPORTS_STATE": {
									"type": "boolean"
								},
								"OAUTH_CAP_REQUIRES_VERIFY_STATE": {
									"type": "boolean"
								},
								"OAUTH_CAP_GET_USERNAME_USES_POST_REQUEST": {
									"type": "boolean"
								},
								"OAUTH_CAP_CLIENT_SECRET_IN_URL_QUERY_PARAM": {
									"type": "boolean"
								},
								"OAUTH_CAP_FIXED_PORT_IN_CALLBACK_URL": {
									"type": "boolean"
								},
								"OAUTH_CAP_SUPPORTS_HTTP_SCHEME_LOOPBACK_REDIRECT_URLS": {
									"type": "boolean"
								},
								"OAUTH_CAP_REQUIRES_PROMPT_CONSENT": {
									"type": "boolean"
								},
								"OAUTH_CAP_REQUIRES_PROMPT_SELECT_ACCOUNT": {
									"type": "boolean"
								},
								"OAUTH_CAP_SUPPORTS_GET_USERINFO_FROM_ID_TOKEN": {
									"type": "boolean"
								}
							}
						},
						"accessTokenResponseMaps": {
							"description": "Key value pair that maps an initial token request response attribute to Tableau recognized attribute",
							"type": "object",
							"properties": {
								"ACCESSTOKEN": {
									"type": "string",
									"maxLength": 256
								},
								"REFRESHTOKEN": {
									"type": "string",
									"maxLength": 256
								},
								"access-token-issue-time": {
									"type": "string",
									"maxLength": 256
								},
								"access-token-expires-in": {
									"type": "string",
									"maxLength": 256
								},
								"username": {
									"type": "string",
									"maxLength": 256
								}
							}
						},
						"refreshTokenResponseMaps": {
							"description": "Key value pair that maps a refresh token request response attribute to Tableau recognized attribute",
							"type": "object"
						}
					},
					"required": [
						"authUri",
						"tokenUri",
						"scopes",
						"accessTokenResponseMaps"
					]
				}
			}
		},
		"permission": {
			"type": "object",
			"properties": {
				"api": {
					"type": "object",
					"properties": {
						"GET": {
							"description": "GET endpoint",
							"type": "string",
							"maxLength": 256
						},
						"HEAD": {
							"description": "HEAD endpoint",
							"type": "string",
							"maxLength": 256
						},
						"POST": {
							"description": "POST endpoint",
							"type": "string",
							"maxLength": 256
						}
					}
				},
				"disk": {
					"type": "object",
					"properties": {
						"path": {
							"description": "TODO: Get Description",
							"type": "array"
						},
						"size": {
							"description": "TODO: Get Description",
							"type": "string",
							"maxLength": 256
						}
					},
					"required": [
						"path",
						"size"
					]
				},
				"libs": {
					"description": "Array of required libraries",
					"type": "array"
				}
			}
		},
		"config": {
			"description": "Extra config part for use only by user.",
			"type": "object"
		}
	},
	"required": [
		"name",
		"version",
		"tableau-version",
		"vendor",
		"permission"
	]
}