---
title: "Test a custom transformer"
method: POST
path: "/api/transformers/test"
tags: ["Transformers"]
---

# Test a custom transformer

`POST /api/transformers/test`

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

## Request body

- object
  - `testRequest` TransformerTestRequest, required — Request payload for testing a custom transformer.
    - `inputData` string, required — The raw input data string to pass to the transformer. The expected format depends on the transformer's `inputType` (e.g. a JSON-serialised array of time-values, or a raw file path for `any`).
    - `options` object — Optional transformer-specific options object passed alongside the input data.
  - `transformer` CustomTransformerCommandDTO, required — Command Data Transfer Object for creating or updating a custom transformer.
    - `type` 'custom', required — The type of the transformer (always 'custom' for this interface).
    - `inputType` string, required — The input data type that the transformer accepts.
    - `outputType` string, required — The output data type that the transformer produces.
    - `name` string, required — The name of the custom transformer.
    - `description` string, required — A description of what the custom transformer does.
    - `customCode` string, required — The custom JavaScript code that implements the transformation logic.
    - `customManifest` OIBusObjectAttribute, required — Object-type attribute that groups related attributes. Used to create nested form structures.
      - `type` 'object', required — The type of this attribute (always "object").
      - `key` string, required — The unique key/identifier for this attribute.
      - `translationKey` string, required — Translation key for internationalization.
      - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
        - `type` 'REQUIRED' | 'MINIMUM' | 'MAXIMUM' | 'POSITIVE_INTEGER' | 'VALID_CRON' | 'PATTERN' | 'UNIQUE' | 'SINGLE_TRUE' | 'MQTT_TOPIC_OVERLAP' | 'PLATFORM', required — Type representing the possible validator types for OIBus form attributes.
        - `arguments` string[], required — Arguments for the validator. For example, for MINIMUM validator: ["10"] would set minimum value to 10.
      - `attributes` OIBusAttribute[], required — Child attributes contained within this object.
        - union — Union type representing all possible OIBus form attributes. Includes both displayable attributes and array/object containers.
          - OIBusObjectAttribute — recursive
          - OIBusStringAttribute — Text input attribute.
            - `type` 'string', required — The type of this attribute (always "string").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `defaultValue` string, nullable, required — Default value for this attribute.
          - OIBusCodeAttribute — Code editor attribute for SQL or JSON content.
            - `type` 'code', required — The type of this attribute (always "code").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `contentType` 'sql' | 'json', required — Type of content for syntax highlighting.
            - `defaultValue` string, nullable, required — Default value for this attribute.
          - OIBusStringSelectAttribute — Dropdown select attribute with predefined string options.
            - `type` 'string-select', required — The type of this attribute (always "string-select").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `selectableValues` string[], required — Available options for selection.
            - `defaultValue` string, nullable, required — Default selected value.
          - OIBusSecretAttribute — Secret/password input attribute. Value is masked in the UI.
            - `type` 'secret', required — The type of this attribute (always "secret").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
          - OIBusNumberAttribute — Numeric input attribute.
            - `type` 'number', required — The type of this attribute (always "number").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `defaultValue` number, double, nullable, required — Default value for this attribute.
            - `unit` string, nullable, required — Unit of measurement for this number (e.g., "ms", "kb"). Displayed next to the input field.
          - OIBusBooleanAttribute — Boolean (checkbox/toggle) attribute.
            - `type` 'boolean', required — The type of this attribute (always "boolean").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `defaultValue` boolean, required — Default value for this attribute.
          - OIBusInstantAttribute — Date/time picker attribute.
            - `type` 'instant', required — The type of this attribute (always "instant").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
          - OIBusScanModeAttribute — Scan mode selection attribute. Used for configuring how often data should be collected.
            - `type` 'scan-mode', required — The type of this attribute (always "scan-mode").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `acceptableType` 'POLL' | 'SUBSCRIPTION_AND_POLL' | 'SUBSCRIPTION', required — What types of scan modes are acceptable. POLL: Regular interval polling SUBSCRIPTION: Real-time subscription SUBSCRIPTION_AND_POLL: Both real-time and polling
          - OIBusCertificateAttribute — Certificate upload/selection attribute.
            - `type` 'certificate', required — The type of this attribute (always "certificate").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
          - OIBusTimezoneAttribute — Timezone selection attribute.
            - `type` 'timezone', required — The type of this attribute (always "timezone").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `displayProperties` OIBusAttributeDisplayProperties, required — Display properties for individual form attributes. Controls layout and visibility in form view.
              - …
            - `defaultValue` string, nullable, required — Default timezone value.
          - OIBusArrayAttribute — Array attribute for managing collections of objects. Used for repeatable sections in forms.
            - `type` 'array', required — The type of this attribute (always "array").
            - `key` string, required — The unique key/identifier for this attribute.
            - `translationKey` string, required — Translation key for internationalization.
            - `validators` OIBusAttributeValidator[], required — Validators to apply to this attribute.
              - …
            - `paginate` boolean, required — Whether to paginate the array elements.
            - `numberOfElementPerPage` number, double, required — Number of elements to display per page when paginated.
            - `rootAttribute` OIBusObjectAttribute, required — recursive
      - `enablingConditions` OIBusEnablingCondition[], required — Conditions that determine when this object should be enabled.
        - `targetPathFromRoot` string, required — Path to the attribute that should be enabled/disabled.
        - `referralPathFromRoot` string, required — Path to the attribute whose value determines the enabling condition.
        - `values` union[], required — Values of the referral attribute that will enable the target attribute.
          - union
            - string
            - number, double
            - boolean
        - `operator` 'EQUALS' | 'CONTAINS' | 'NOT_EQUAL' — Operator to use for the condition. EQUALS: The referral attribute value must be equal to one of the values. CONTAINS: The referral attribute value must contain one of the values (string only).
      - `displayProperties` OIBusObjectDisplayProperties, required — Display properties for object-type form attributes. Controls visibility and styling of object containers.
        - `visible` boolean, required — Whether this object should be visible in the form.
        - `wrapInBox` boolean, required — Whether this object should be wrapped in a visual box/container.
    - `language` string, required
    - `timeout` number, double, required — The maximum execution time for the custom code in milliseconds.

## Response `200`

The transformation output and execution metadata

- TransformerTestResponse — Response from a transformer test run.
  - `output` string, required — The serialised transformation output produced by the transformer.
  - `metadata` object, required — Execution metadata produced during the test run.
    - `numberOfElement` number, double, required — Number of data elements in the output (e.g. number of time-value points).
    - `createdAt` string, required — Represents an instant in time as an ISO 8601 string.
    - `contentSize` number, double, required — Size of the output content in bytes.
    - `contentFile` string, required — File path of the output content, if the transformer produced a file.
    - `contentType` string, required — MIME type of the output content.

---

[API](https://skmtc.net/optimistiksas/apis/oibus-api.md) · [All operations](https://skmtc.net/optimistiksas/apis/oibus-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/optimistiksas/oibus-api/versions/743d1b62f042/schema)
