skip to main content
Input REST file syntax : Table definition entries
  

Try DataDirect Drivers Now

Table definition entries

Table definition entries define the mapping of JSON endpoints to tables. You can specify a single entry or, in a comma separated list, multiple entries. These entries can be as simple as a colon-separated table name and endpoint pair ("<table_name>":"<endpoint>",). Or, for a greater level of configuration, entries can take the form of JSON objects.
The following demonstrates the syntax of a set of three simple table definition entries. For endpoint details and syntax, see "Query paths."
"<table_name1>":"<endpoint1>",
"<table_name2>":"<endpoint2>",
"<table_name3>":"<endpoint3>"
The following demonstrates the syntax used to configure a single table entry in an array.
Note: The following example demonstrates the syntax for all the features and functionality supported by the driver, but it is not typical for defining a table. In most scenarios, only a subset of these parameters would be used to define a table.
1 {
2 "<table_name>": {
3 "#path":["<endpoint>"],
4 "#<paging_parameter>":"<paging_value>",
5 "#<parsing_parameter>":"<parsing_value>",
6 // The following POST entry defines two fields.You can define one or more
7 // fields in an entry.
8 "#post":{"<field1>":"<value1>","<field2>":"<value2>"}
9 //The following HTTP header entry defines two headers. You can define one or more
10 //headers in an entry.
11 "#headers":{"<header1>":"<value1>","<header2>":"<value2>"}
12 "<column1>":"<data_type>",
13 "<column2>":"<data_type>,#key",
14 //The following array defines two nested columns. You can define one or more
15 //nested columns in an array.
16 "<column3>[]":{"<column_a>:<data_type>","<column_b>":"<data_type>"}
17 //The following key-map defines two columns. You can define one or more
18 //columns in a key map.
19 "<column4>{<data_type>}":{"<column_c>:<data_type>","<column_d>":"<data_type>"}
20 //The following column defines two nested objects. You can define one or more
21 //nested columns in table definition.
22 "<column5>":{"<nested_column1>":"<data_type>","<nested_column2>":"<data_type>"}
23 "<column6>":"<data_type>","<java_date_format>"
24 "<column7>":{"#type":"<data_type>","#extract:<reg_expression>"}
25 "<column8>":{"#type":"<data_type>","#header":true,"#eq":"<header_name>"}
26 "<column9>":{"#type":"<data_type>","#<operator>":"<uri_property>"}
27 }
28 }
Table 27. Components of a table definition entry
Lines
Entry/Entry Type
Description
2
Table name
(Required) Specifies the name of the table.
3
#path
(Required) Specifies the query path to an endpoint(s) that the driver connects to and samples. This can be a full endpoint, the path portion of an endpoint, or an array of endpoints.
For details and syntax, see Query paths.
4
Paging parameters
Configures paging behavior for the table using a set of parameters. These parameters differ based on the paging mechanisms you want to employ.
For details and syntax, see Paging .
5
Parsing parameters
Configures the parsing behavior of the driver using a set of parameters. This allows the driver to accurately parse services that do not use pure REST syntax, such as legacy or proprietary services.
For details and syntax, see REST model parsing.
8
#post
Defines the sample values used when issuing a POST request. This section is mutually exclusive with the #headers property.
For details and syntax, see POST requests.
11
#headers
Specifies the HTTP headers to filter data returned by a GET request. This section is mutually exclusive with the #post property.
For details and syntax, see Requests with custom HTTP headers .
12-26
Column definitions
Defines the name of the column and additional mapping. Column names can be literal or regular expressions. You can also configure data type mapping in these fields.
For details and syntax, see Column names and Data type mapping.
13
Primary key
Designates the primary key by specifying the #key element in a column definition.
For details and syntax, see Primary key.
16
Column as an array
Defines a column as an array by specifying brackets ([]) at the end of its column name.
For details and syntax, see Columns as an array.
19
Column as key-value map
Defines a column as an key-value map by specifying brackets ({}) at the end of its column name.
For details and syntax, see Columns as a key-value map.
22
Column with nested objects
Defines a column with nested objects in the entry body.
For details and syntax, see Columns with nested objects .
23
Time stamp formats
Defines the time stamp format for a column in the definition.
For details and syntax, see Date, time, and timestamp formats.
24
#extract
Specifies a regular expression that allows you to extract a subfield, or portion, of a string value.
For details and syntax, see Subfields .
25
#header
Specifies whether the column can be sent as an HTTP header instead of part of a query string for GET requests.
For details and syntax, see Columns as HTTP headers.
26
Filtering and URI parameters
Specifies filtering operations to be sent in requests for the column.
For details and syntax, see Filtering and URI parameters.
* Paging
* REST model parsing
* POST requests
* Requests with custom HTTP headers
* Query paths
* Column names
* Data type mapping
* Primary key
* Columns as an array
* Columns as a key-value map
* Columns with nested objects
* Date, time, and timestamp formats
* Subfields
* Columns as HTTP headers
* Filtering and URI parameters