Model file syntax
- Last Updated: October 3, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- Autonomous REST Connector 6.0
- Documentation
The driver employs a Model file to map JSON responses to the relational model. Although the primary purpose of the Model file is to define endpoint and table mapping, it is also capable of configuring a number of driver behaviors, such as paging, custom authentication, and HTTP response code processing. This reference describes the syntax used to configure the features and functionality supported by the Model file.
The Model file is a simple text file that uses the file_name.rest naming convention. To configure the file, you will need to populate its contents. You can do this using a text editor or by generating a file using the Configuration Manager. For more information on using the Autonomous REST Composer to generate a Model file, see Generating a Model file with the Autonomous REST Composer.
The following is the basic structure of the Model file:
1 {
2 "#http":[<http_response_codes>],
3
4 "#<oauth2_param>":"<oauth2_value>",
5
6 "#authentication":[<custom_auth>],
7 "#reauthentication":[<custom_auth>],
8
9 "<table_name1>":"<table_definition1>",
10 "<table_name2>":"<table_definition2>",
11 "<table_name3>":"<table_definition3>"
12
13 "routines":["<function_definition1>",
14 "<function_definition2>",
15 "<function_definition3>"
16 ]
17 }
| Lines | Entry/Entry Type | Description |
|---|---|---|
| 2 | #http |
Defines how HTTP response status codes are processed by the
driver. For details and syntax, see HTTP response code processing. |
| 4 | OAuth 2.0 entries | Configures OAuth 2.0 authentication behavior using a set of
entries. This allows you to centrally set and manage OAuth authentication properties
for all connections using the file. Note that these entries are mutually exclusive
with the #authentication entry.For details and syntax, see OAuth 2.0 authentication. |
| 6 | #authentication |
Defines custom authentication requests that retrieve and
exchange access tokens. Custom authentication is used when your service does not
support one of the standard authentication methods provided by the driver. Note that
this entry is mutually exclusive with the OAuth 2.0 entries. For details and syntax, see Custom authentication requests. |
| 7 | #reauthentication |
Defines the request used to refresh the access token retrieved through the
#authentication entry.For details and syntax, see Custom authentication requests. |
| 9-11 | table entries | Defines the tables and columns that are derived from REST
endpoints. This section can be used to configure multiple aspects of the driver's
behavior, including paging, data type mapping, and filtering. For details and syntax, see Table definition entries. |
| 13-16 | User defined functions and procedures | Defines the user or Progress defined functions and procedures that can be
called by the driver. For details and syntax, see User-defined functions and procedures. |