american:
- Boston Red Sox
- Detroit Tigers
- New York Yankees
national:
- New York Mets
- Chicago Cubs
- Atlanta Braves
yaml
YAML Format
MIME Type: application/yaml
ID: yaml
Values in the YAML data format map one-to-one with DataWeave values. DataWeave natively supports all of the following YAML types:
-
String
-
Boolean
-
Number
-
Nil
-
Mapping
-
Sequences
Example: Represent YAML in the DataWeave Format (dw)
This example shows how DataWeave represents YAML values.
Input
The following YAML snippet serves as the input payload for the DataWeave source in this example.
Source
The DataWeave script transforms the YAML encoded input payload to the DataWeave (dw) format and MIME type.
%dw 2.0
output application/dw
---
payload
dataweave
Output
The following output shows how the YAML input is represented in the DataWeave (dw
) format.
{
"american": [
"Boston Red Sox",
"Detroit Tigers",
"New York Yankees"
],
"national": [
"New York Mets",
"Chicago Cubs",
"Atlanta Braves"
]
}
dataweave
Configuration Properties
DataWeave supports the following configuration properties for the YAML format.
Reader Properties
The YAML format accepts properties that provide instructions for reading input data.
Parameter | Type | Default | Description |
---|---|---|---|
|
|
|
The maximum number of entity expansions. The limit is provided to avoid the billion laughs attack, a denial-of-service attack. |
Writer Properties
The YAML format accepts properties that provide instructions for writing output data.
Parameter | Type | Default | Description |
---|---|---|---|
|
|
|
Size of the writer buffer. |
|
|
|
When set to |
|
|
|
Encoding for the writer to use. |
|
|
|
Skips |
Supported MIME Types
The YAML format supports the following MIME types.
MIME Type |
---|
|
|
|
|