The Configure Schema editor should be used to generate the OData schema map as described in Configuring OData data sources. In rare cases, manual editing of the schema map might be necessary. For OData Version 4 services, an odata_mapping_v3 format is supported.

The schema map consists of a JSON string that contains the following properties:

{
    "odata_mapping_v3": {
        "timeAsString": boolean,
        "guidAsString": boolean,
        "unboundNumberAsDouble": boolean,
        "unboundNumberPrecision": integer,
        "unboundNumberScale": integer,
        "entityNameMode": "enum",
        "singularSuffix": "suffix",
        "schemas": [
            {
                "name": "schema1_name",
                "tables": {
                    "table1_name": {
                        "ODataAlias": "odata_name",
                        "ODataPluralAlias": "plural_odata_name",
                        "searchMode": "enum",
                        "columns": {
                            "column1_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"]
                    },
                    "table2_name": {...}
                },
                "excludedTables": ["table_name"]
            }
        ]
    }
}

Property descriptions

See the following tables for descriptions of schema map properties.

Root properties

Property Description
odata_mapping_v3 Root container for the mapping configuration.

Schema map properties

Property Description
timeAsString Indicates whether time values should be converted to strings.
guidAsString Indicates whether 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.
unboundNumberAsDouble 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.
unboundNumberPrecision Indicates the effective precision 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 38 is used.
unboundNumberScale 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.
entityNameMode 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".
  • "pluralize": Pluralize entity names
  • "guess": Automatically guess appropriate naming (default
  • "singularize": Singularize entity names
  • "suffix": Use suffix naming mode
singularSuffix 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".
schemas Array of database schemas to map.

Schema properties

Property Description
name The backend data source schema name. This is a required field. For data stores that do not support schemas, such as MySQL, the name value should be null ("name": null).
tables Contains table elements describing how to expose tables through OData. If the tables object is missing or empty, all tables, except for any table in the excludedTables array, are exposed.
excludedTables 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.

Table properties

Property Description
ODataAlias The singular entity name to use in OData addresses for requests to this table.
ODataPluralAlias The plural entity name to use in OData requests.
searchMode Applies to columns enabled for search. Determines whether a column is searchable and the method used to search it.
  • "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
columns Contains column 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 Comma-separated list of columns to hide from OData requests. This optional field is used only when the columns object is missing or empty.

Column properties

Property Description
primaryKeyComponent 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 If true, the column is searchable, using the searchMode specified at the table level. If false, the column is not searchable.
indexType 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.
alias The name to use as the entity property name for the column.
typeInfo Advanced type information that is used to override the information that was discovered using the JDBC driver. Normally, this information should not be specified.

TypeInfo properties

Property Description
columnSize 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 Indicates the maximum scale of the column.
dataType Indicates the desired data type for the column. The data type is specified as the JDBC type name.
isNullable 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.
isAutoIncrement 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, update, and patch entity operations.
isGenerated Indicates whether the column is a generated value. If the column is generated, then the OData code will ignore incoming values for this column during create, update, and patch entity requests.