latestOpenAPI 3.0.0EUPLraw.githubusercontent.com2026-08-191426201.0 MB

fe8fd32c9fdc

Transformers

Test a custom transformer

Runs a custom transformer against the provided input data and returns the transformed output. Use this endpoint to validate transformer logic before saving it.

post/api/transformers/test

Request body

Example request

{
  "testRequest": {
    "inputData": "[{\"timestamp\":\"2024-01-01T00:00:00.000Z\",\"pointId\":\"sensor1\",\"value\":\"42.0\"}]",
    "options": {
      "precision": 2
    }
  },
  "transformer": {
    "inputType": "string",
    "outputType": "number",
    "name": "String to Number",
    "description": "Converts string input to numeric output",
    "customCode": "function transform(input) { return parseFloat(input); }",
    "customManifest": {
      "key": "serverUrl",
      "translationKey": "connection.serverUrl",
      "validators": [
        {
          "arguments": []
        }
      ],
      "attributes": [
        {
          "key": "serverUrl",
          "translationKey": "connection.serverUrl",
          "validators": [
            {
              "arguments": []
            }
          ],
          "displayProperties": {
            "row": 1,
            "columns": 6,
            "displayInViewMode": true
          },
          "defaultValue": "oibus-client"
        }
      ],
      "enablingConditions": [
        {
          "targetPathFromRoot": "protocol",
          "referralPathFromRoot": "connection.type",
          "values": [
            "MQTT"
          ],
          "operator": "EQUALS"
        }
      ],
      "displayProperties": {
        "visible": true,
        "wrapInBox": true
      }
    },
    "timeout": 2000
  }
}

Response

The transformation output and execution metadata

outputstring required

The serialised transformation output produced by the transformer.

Example response

{
  "output": "{\"topic\":\"sensors/sensor1\",\"payload\":42}",
  "metadata": {
    "numberOfElement": 1,
    "createdAt": "2023-10-31T12:34:56.789Z",
    "contentSize": 256,
    "contentFile": "/tmp/transformer-output-1234.csv",
    "contentType": "application/json"
  }
}