JSON Schema Transformer

The JSON Transform feature enables modification and enrichment of incoming content within the pipeline. This component allows the application of mappings, operations, and conditions to customize and transform the pipeline data.

Mappings

Mappings can be used to rename JSON properties, remove unnecessary content, or add new data. Expression conditions control when these mapping actions are applied. For more details, see the following section Operators.

Here is an example of JSON Transform configuration with mappings.

{
  "mappings": [
    {
      "source_path": "post.id",
      "destination_path": "id",
      "type": "string"
    },
    {
      "source_path": "post.created_at",
      "destination_path": "doc_date",
      "type": "date"
    },
    {
      "source_path": "post.comment",
      "destination_path": "content.body",
      "type": "date",
      "condition": {
        "path": "type",
        "operator": "eq",
        "value_type": "string",
        "value": "comment"
      }
    }
  ]
}

Operations

Operations are a key feature of the JSON Transformation component, allowing content manipulation. Available operations enable formatting, concatenation, mapping, content extraction, and more. All operations support conditions.

{
  "mappings": [
    {
      "source_path": "post.id",
      "destination_path": "id",
      "type": "string"
    },
    {
      "source_path": "post.created_at",
      "destination_path": "doc_date",
      "type": "date"
    },
    {
      "source_path": "post.comment",
      "destination_path": "content.body",
      "type": "date",
      "condition": {
        "path": "type",
        "operator": "eq",
        "value_type": "string",
        "value": "comment"
      }
    },
    {
      "type": "operation",
      "name": "format",
      "destination_path": "source.link",
      "parameters": {
        "fields": [
          "post.id"
        ],
        "format": "https://example.com/comments/{0}"
      },
      "condition": {
        "path": "type",
        "operator": "eq",
        "value_type": "string",
        "value": "comment"
      }
    }
  ]
}

See