Other Data and Translation
- 21 Nov 2022
-
DarkLight
-
PDF
Other Data and Translation
- Updated on 21 Nov 2022
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
You can create a schema that includes some of the data that you want (e.g., for validation or to translate), and also specify that you want the other data to remain as is.
By setting dynamicfields to true, you are telling the translator that if the field is not defined, pass the data “as is”.
When the external_name is different than the property name, the adapter knows to translate or map the data in the objects that it sends and receives so that IAP receives the data in a field that matches the property name and the other system receives the data in a field that matches external_name. For example:
- {objectId: 123} goes to System A
- {componentId: 123} goes to IAP
Example: Schema with Dynamic Fields and External Name
"$id": "sevone_alert",
"type": "object",
"schema": "http://json-schema.org/draft-07/schema#",
"translate": true,
"dynamicfields": true,
"properties": {
"ph_request_type": {
….
},
"deviceId": {
"type": "integer",
"description": "the id of the device this alert originated on",
"external_name": "deviceId"
},
"componentId": {
"type": "integer",
"description": "the id of the object/device componenet this alert originated on",
"external_name": "objectId"
}
},
"definitions": {}
Was this article helpful?