skip to main content
Querying with OData Version 4 : Understanding and configuring a schema map for OData Version 4 : JSON schema map syntax
  

Try Now

JSON schema map syntax

The Configure Schema editor should be used to generate the OData schema map as described in Configuring data sources for OData Version 4 connectivity. In rare cases, manual editing of the schema map might be necessary. For OData Version 4 services, an odata_mapping_v3 format is supported.
A schema map consists of a JSON string that contains the following model elements.
{
"odata_mapping_v3": {
"timeAsString": «boolean»,
"guidAsString": «boolean»,
"unboundNumberAsDouble": «boolean»,
"unboundNumberPrecision": «integer»,
"unboundNumberScale": «integer»,
"entityNameMode": "pluralize" or "guess" or "singularize" or "suffix",
"singularSuffix": "«suffix»",
"schemas": [
{
"name": "«schema_name»",
"tables": {
"«table_name»": {
"ODataAlias": "«odata_name»",
"ODataPluralAlias": "«plural_odata_name»",
"searchMode": "none" or "begins" or "contains" or "full-text",

"columns": {
"«column_name»": {
"primaryKeyComponent": «integer»,
"searchable": «boolean»,
"indexType": "«text_index_name»",
"alias": "«alias_name»",
"typeInfo": {
"columnSize": «integer»,
"scale": «integer»,
"dataType": "type_name",
"isNullable": «boolean»,
"isAutoIncrement": «boolean»,
"isGenerated": «boolean»
}
},
"«column2_name»": {
...
},
...
},
"excludedColumns": ["«column_name»", ...]
},
"«table_name»": {
...
},
...
},
"excludedTables": ["«table_name»", ...]
}
]
}
}
The following table lists the various elements and provides a brief description. See Schema map examples for sample usage.
Element name
Parent
Description
unboundNumberAsDouble
odata_mapping_v3
Indicates whether decimal columns, parameters and return values defined with no precision and scale should get automatically mapped to 'double'. This is the current default behavior for Oracle NUMBER columns declared with no precision or scale. This option allows you to map these types to OData 4 decimal type with variable scale. The default is true. When false, the OData model will describe the column or parameter as having a precision of 38 and having a scale set to "variable". The defaults for precision and scale may be overriden using the unboundNumberPrecision and unboundNumberScale elements.
entityNameMode
odata_mapping_v3
Indicates the algorithm used to map the table names to the entity collection name and the entity type name. The entity collection name is normally the plural form and the entity type name is the singular form. Defaults to "guess".
singularSuffix
odata_mapping_v3
The suffix to use for the singular name (entity type) that is used during the suffix naming mode. This suffix may also be used in the other naming modes in some scenarios. Default value is "_type".
unboundNumberPrecision
odata_mapping_v3
Indicates the effective precision for unbound numbers that are mapped to decimal. This opiton only applies when unboundNumberAsDouble is false and only applies to numbers that have been designated as being unbound. When not specified, a default of 38 is used.
unboundNumberScale
odata_mapping_v3
Indicates the effective scale for unbound numbers that are mapped to decimal. This option only applies when unboundNumberAsDouble is false and only applies to numbers that have been designated as being unbound. When not specified, a default of "variable" is used.
guidAsString
odata_mapping_v3
Indicates whether or not GUID data types are exposed as OData Edm.String. The default is false, which means that GUID data types are exposed as Edm.Guid. This option currently only applies to the SQL Server uniqueidentifier data type.
schema_name
None
The backend data source schema name. This is a required field. For data stores that do not support schemas, such as MySQL, the schemaName value should be null ("schemaName": null).
excludedTables
schema_name
Comma-separated list of tables to hide from OData requests. Any tables not specified in this list, and having a primary key column will be exposed for OData requests. This optional field is used only when the tables object is missing or empty.
name
schema_name
Contains the schema_name element. This is a required property for data sources that support schemas. For data sources such as MySQL that do not support schemas, set this to "null" or "-".
table_name
tables
The backend data source table (or object) name. This property determines the name to be used in OData requests.
tables
schema_name
Contains table_name elements describing how to expose tables through OData, and an excludedTables element listing tables that should not be exposed. If the tables object is missing or empty, all tables, except for any table in the excludedTables array, are exposed.
columns
table_name
Contains column_name elements that define the details of columns included in a table. If the columns element is missing or empty, then all columns except the ones listed in excludeColumns are exposed.
excludedColumns
table_name
Comma-separated list of columns to hide from OData requests. This optional field is used only when the columns object is missing or empty.
ODataAlias
table_name
The singular entity name to use in OData addresses for requests to this table.
ODataPluralAlias
table_name
The plural entity name to use in OData requests.
searchMode
table_name
One of: none, not searchable; begins, search for the string only at the beginning of a field; contains, search for a specific string; full-text, use the data source index. The searchMode applies to columns enabled for search.
column_name
columns
The backend data source column (or field) name. Column properties determine whether the column is part of the primary key and is searchable.
typeInfo
column_name
Advanced type information that is used to override the information that was discovered using the JDBC driver. Normally, this information should not be specified.
column_alias
column_name
The name to use as the entity property name for the column.
indexType
column_name
The model contains this element to identify the type of index when the search mode is set to Full Text. For DB2 and SQL Server, TEXT is the only valid value. For Oracle, valid values include CONTEXT and CTXCAT.
primaryKeyComponent
column_name
The data type of a column belonging to the primary key, or null. The primary key is comprised of a set of columns to be used as the primary key for a table that does not have a defined primary key. If this field is not specified or the key list is empty, the table must have a primary key defined in the database. If a primary key is defined for the table in the database and a primary key column list is also specified in the OData Schema Map parameter, the primary key defined in the database is used.
searchable
column_name
If true, the column is searchable, using the searchMode specified at the table level. If false, the column is not searchable.
isNullable
typeInfo
Indicates whether the column can have a null value. Normally drivers report this correctly. Some drivers may report a column as not nullable while null values exist in the column. In such a scenario, the isNullable could be set to true to correct this issue. Note, there could be implications on the 'create entity' behavior by changing this setting.
dataType
typeInfo
Indicates the desired data type for the column. The data type is specified as the JDBC type name.
isAutoIncrement
typeInfo
Indicates whether the column is a uniquely generated column. Setting this to true will indicate to the service that it should ignore incoming values for this column during 'create entity' and 'update/patch entity' operations.
isGenerated
typeInfo
Indicates whether the column is a generated value. If the column is generated, then the OData code will ignore incoming value for column during the 'create entity' and 'update/patch entity' requests.
dataType
typeInfo
Indicates the desired data type for the column. The data type is specified as the JDBC type name.
columnSize
type_info
Indicates the maximum precision or maximum length of the column. Some drivers may report column sizes that are not accurate or are too large.
scale
type_info
Indicates the maximum scale of the column.