embed-in-json
| Latest Version | v1.0.0 |
| Input Content Type | Any |
| Output Content Type | application/json |
The embed-in-json transformer embeds data as a UTF-8 JSON string value for the
specifed string key in a new JSON object.
Tip
When dealing with binary data, it may be helpful to use the base64
transformer to encode the data as text prior
to embedding. The json-patch
transformer may be used to modify the
JSON object after embedding.
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
key | string | The key that input data should be assigned to. | ✅ |
Example Usage
transformer:
type: embed-in-json
version: v1
parameters:
key: original
Example Input
hello, world!
Example Output
{
"original": "hello, world!"
}