{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oracle-essbase/json-schema/oracle-essbase-datasource-schema.json",
  "title": "Datasource",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-essbase-rest-api-openapi.yml#/components/schemas/Datasource",
  "type": "object",
  "required": [
    "application",
    "columns",
    "connection",
    "cube",
    "description",
    "query",
    "sheet",
    "startRow",
    "type",
    "widths"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "TEMPLATE",
        "EXCELFILE",
        "DB",
        "DELIMITEDFILE",
        "FIXEDWIDTHFILE",
        "BI",
        "ESSBASE",
        "JDBC",
        "SPARK",
        "MS_SQL",
        "MYSQL",
        "DB2",
        "ORACLE",
        "FILE",
        "AI"
      ]
    },
    "connection": {
      "type": "string",
      "description": "<p>Connection used for this Datasource.</p>"
    },
    "description": {
      "type": "string",
      "description": "<p>Optional description of this Datasource.</p>"
    },
    "columns": {
      "$ref": "#/$defs/ColumnsType"
    },
    "name": {
      "type": "string",
      "description": "<p>Datasource name. Must begin with a letter. Can contain only letters, underscore character, and digits.</p>"
    },
    "ignoreErrorRecords": {
      "type": "boolean"
    },
    "delimeter": {
      "type": "string",
      "description": "<p>Delimiter of the data records, if Datasource <i>type</i> is <code>DELIMITEDFILE</code>. Delimiter can be <code>Comma</code> for CSV format or <code>Tab</code> for tab-separated format. To use a custom delimiter, use value <code>Custom</code>, and provide the delimiter as a value to <i>customDelimiter</i>.</p>"
    },
    "customDelimiter": {
      "type": "string",
      "description": "<p>Custom delimiter of the data records, if the value provided for <i>delimiter</i> is <code>Custom</code>.</p>"
    },
    "query": {
      "type": "string",
      "description": "<p>Query associated with the Datasource. For example, a SQL query for an external database, or an MDX query for another Essbase cube. The query selects which data you want to make available in this Datasource.</p>"
    },
    "application": {
      "type": "string",
      "description": "<p>Applicable if the <i>type</i> of Datasource is ESSBASE. The Essbase application name.</p>"
    },
    "cube": {
      "type": "string",
      "description": "<p>Applicable if the <i>type</i> of Datasource is ESSBASE. The Essbase database name.</p>"
    },
    "startRow": {
      "type": "integer",
      "format": "int64",
      "description": "<p>Optional (default is 1 if not given). For a Datasource that is an Excel or text file, the starting data row number, excluding headerRow if one exists. For example, if headerRow is specified as 1 and startRow is specified as 10, the actual starting data row will be 11.</p>"
    },
    "endRow": {
      "type": "integer",
      "format": "int64",
      "description": "<p>For a Datasource that is an Excel or text file, the ending row number.</p>"
    },
    "headerRow": {
      "type": "integer",
      "format": "int64",
      "description": "<p>For a Datasource that is an Excel or text file, the header row number. 0 if there is no header.</p>"
    },
    "sheet": {
      "type": "string",
      "description": "<p>For a Datasource that is an Excel file, the worksheet name.</p>"
    },
    "skipHiddenRows": {
      "type": "boolean"
    },
    "widths": {
      "type": "array",
      "items": {
        "type": "integer",
        "format": "int64"
      }
    },
    "queryParameters": {
      "type": "array",
      "description": "<p>Parameter implementation details, if the Datasource query is parameterized. For example, if the query includes a <code>?</code> placeholder for passing a parameter, as in the following query: <code>select * from profit_data where year=?</code>, then you need define the implementation details.</p>",
      "items": {
        "$ref": "#/$defs/QueryParamsInfo"
      }
    },
    "headers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HeaderType"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Link"
      }
    }
  },
  "$defs": {
    "ColumnType": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "STRING",
            "DOUBLE",
            "DATE",
            "TIMESTAMP",
            "LONG"
          ]
        },
        "nullable": {
          "type": "boolean"
        },
        "format": {
          "type": "string"
        },
        "index": {
          "type": "integer",
          "format": "int32"
        },
        "system": {
          "type": "boolean"
        }
      }
    },
    "ColumnsType": {
      "type": "object",
      "required": [
        "column"
      ],
      "properties": {
        "column": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ColumnType"
          }
        }
      }
    },
    "HeaderType": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "cell": {
          "type": "string"
        }
      }
    },
    "Link": {
      "type": "object",
      "properties": {
        "rel": {
          "type": "string"
        },
        "href": {
          "type": "string"
        },
        "method": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      }
    },
    "QueryParamsInfo": {
      "type": "object",
      "properties": {
        "index": {
          "type": "integer",
          "format": "int32",
          "description": "<p>Ordinal index of the Datasource query parameter. For example, 1 for the first parameter, 2 for the second parameter, etc.</p>"
        },
        "name": {
          "type": "string",
          "description": "<p>Optional name for the Datasource query parameter, meaningful for your use case. For example, instead of Param1 you can use param_G_month to indicate that the parameter uses a global variable for the current month, or you can rename it to param_appName_month to indicate that the parameter uses an application-level variable for the current month.</p>"
        },
        "defaultValue": {
          "type": "string",
          "description": "<p>A fixed, default parameter value that the Datasource should use as a fallback in case the parameter has an invalid context at runtime. Example: <b>Jan</b>. Required only if the Datasource query is parameterized (it includes a <code>?</code> placeholder for passing a parameter) AND the placeholder is not intended to reference a substitution variable nor a user-defined function developed in the external source.</p>"
        },
        "required": {
          "type": "boolean",
          "description": "<p><b>true</b> if the Datasource query parameter is required, or <b>false</b> otherwise.</p>"
        },
        "useSubVariable": {
          "type": "boolean",
          "description": "<p><b>true</b> if the Datasource query parameter references an Essbase substitution variable, or <b>false</b> otherwise.</p>"
        },
        "subVariableName": {
          "type": "string",
          "description": "<p>If <i>useSubVariable</i> is <b>true</b>, the name of an Essbase substitution variable.</p>"
        },
        "type": {
          "type": "string",
          "description": "<p>Datatype of the Datasource query parameter.</p>",
          "enum": [
            "STRING",
            "DOUBLE",
            "DATE",
            "TIMESTAMP",
            "LONG"
          ]
        }
      }
    }
  }
}