Skip to main content

embed-in-json

Latest Versionv1.0.0
Input Content TypeAny
Output Content Typeapplication/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

ParameterTypeDescriptionRequired
keystringThe 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!"
}