---
schema_version: "1"
id: 4fc6832cb2e9e5b01f9a1962fa13a436afa6a6a7fe726d247f1e5247ea52e906
title: YAML Format
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.3/dataweave-formats-yaml.md
canonical_url: https://docs.mulesoft.com/dataweave/2.3/dataweave-formats-yaml
source_site: docs.mulesoft.com
content_type: documentation
content_hash: a8f2b8e1115f9aab1b996133d0d9adbcf9e7dd1c9e6cf799950db09be1aba57f
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
---
product: DataWeave
version: 2.3
---

# YAML Format

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

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.

```yaml
american:
  - Boston Red Sox
  - Detroit Tigers
  - New York Yankees
national:
  - New York Mets
  - Chicago Cubs
  - Atlanta Braves
```

### Source

The DataWeave script transforms the YAML encoded input payload to the DataWeave (dw) format and MIME
type.

```dataweave
%dw 2.0
output application/dw
---
payload
```

### Output

The following output shows how the YAML input is represented in the DataWeave (`dw`) format.

```dataweave
{
  "american": [
    "Boston Red Sox",
    "Detroit Tigers",
    "New York Yankees"
  ],
  "national": [
    "New York Mets",
    "Chicago Cubs",
    "Atlanta Braves"
  ]
}
```

## 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.

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><p><code>maxEntityCount</code></p></td><td><p><code>Number</code></p></td><td><p><code>1</code></p></td><td><div><div><p>The maximum number of entity expansions. The limit is provided to avoid the billion laughs attack, a denial-of-service attack.</p></div></div></td></tr></tbody></table>

### Writer Properties

The YAML format accepts properties that provide instructions for writing output data.

<table><colgroup><col> <col> <col> <col></colgroup><thead><tr><th>Parameter</th><th>Type</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><p><code>bufferSize</code></p></td><td><p><code>Number</code></p></td><td><p><code>8192</code></p></td><td><div><div><p>Size of the writer buffer.</p></div></div></td></tr><tr><td><p><code>deferred</code></p></td><td><p><code>Boolean</code></p></td><td><p><code>false</code></p></td><td><div><div><p>When set to <code>true</code>, DataWeave generates the output as a data stream, and the script’s execution is deferred until it is consumed. Valid values are <code>true</code> or <code>false</code>.</p></div></div></td></tr><tr><td><p><code>encoding</code></p></td><td><p><code>String</code></p></td><td><p><code>UTF-8</code></p></td><td><div><div><p>Encoding for the writer to use.</p></div></div></td></tr><tr><td><p><code>skipNullOn</code></p></td><td><p><code>String</code></p></td><td><p><code>null</code></p></td><td><div><div><p>Skips <code>null</code> values in the specified data structure. Valid values are <code>arrays</code>, <code>objects</code>, or <code>everywhere</code>. The writer does not skip such values unless you set the property.</p></div></div></td></tr></tbody></table>

## Supported MIME Types

The YAML format supports the following MIME types.

<table><colgroup><col></colgroup><thead><tr><th>MIME Type</th></tr></thead><tbody><tr><td><p><code>application/yaml</code></p></td></tr><tr><td><p><code>text/yaml</code></p></td></tr><tr><td><p><code>application/x-yaml</code></p></td></tr><tr><td><p><code>text/x-yaml</code></p></td></tr></tbody></table>
