Field Mappings
Map external database field types to Informer types.
Overview
Field mappings define how database-specific types (e.g., VARCHAR, INT) are translated to Informer's internal types (e.g., string, integer). Mappings can be configured per datasource.
GET /api/datasources/{id}/mappings
Get all field mappings for a datasource.
Response:
{
"_links": {
"self": { "href": "/api/datasources/{id}/mappings" }
},
"_embedded": {
"inf:field-mapping": [
{
"id": "mapping-uuid",
"datasourceId": "mysql-prod",
"externalType": "VARCHAR",
"informerType": "string",
"options": {
"maxLength": 255
}
},
{
"id": "mapping-uuid-2",
"datasourceId": "mysql-prod",
"externalType": "INT",
"informerType": "integer",
"options": {}
}
]
},
"start": 0,
"count": 2,
"total": 2
}
Informer Types:
string- Text datainteger- Whole numbersfloat- Decimal numbersboolean- True/falsedate- Date onlydatetime- Date and timetime- Time onlyjson- JSON databinary- Binary data
POST /api/datasources/{id}/mappings
Create a new field mapping.
Permissions: datasource:write
Request Body:
{
"externalType": "DECIMAL",
"informerType": "float",
"options": {
"precision": 10,
"scale": 2
}
}
Response:
201 Created with mapping object.
GET /api/datasources/{id}/mappings/{mappingId}
Get a specific mapping.
PUT /api/datasources/{id}/mappings/{mappingId}
Update a field mapping.
Request Body:
{
"informerType": "string",
"options": {
"maxLength": 500
}
}
DELETE /api/datasources/{id}/mappings/{mappingId}
Delete a field mapping.
Response:
204 No Content on success.
Mapping Sets
GET /api/mapping-sets
Get pre-defined mapping sets for common databases.
Response:
{
"_links": {
"self": { "href": "/api/mapping-sets" }
},
"_embedded": {
"inf:mapping-set": [
{
"id": "mysql-default",
"name": "MySQL Default Mappings",
"driverType": "mysql",
"mappings": []
}
]
},
"start": 0,
"count": 1,
"total": 1
}
GET /api/mapping-sets/{id}
Get a specific mapping set with all mappings.
Use Case:
Apply standard type mappings when creating a new datasource.