---
schema_version: "1"
id: 5d8f7346532479ab3da08076701c419cd0699366a128765043c5ab4479816d91
title: YAML 形式
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/dataweave/2.3/dataweave-formats-yaml.md
canonical_url: https://docs.mulesoft.com/jp/dataweave/2.3/dataweave-formats-yaml
source_site: docs.mulesoft.com
content_type: documentation
content_hash: fd33c9538adc8e4f5f1e9ba5c14d432a9528df0d813940d53e6a0122aaf575ca
description: MuleSoft Documentation Site
release: "2.3"
latest: false
---
# YAML 形式

MIME タイプ: `application/yaml`​

ID: `yaml`​

YAML データ形式の値は DataWeave 値に一対一でマップされます。 DataWeave では、次のすべての YAML 型がサポートされます。

- `String`​
- `Boolean`​
- `Number`​
- `Nil`​
- `Mapping`​
- `Sequences`

## [](#examples)例: YAML を DataWeave 形式 (dw) で表す

次の例は、YAML 値が DataWeave でどのように表されるかを示しています。

### [](#入力)入力

この例では、次の YAML スニペットが DataWeave ソースの入力ペイロードとして機能します。

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

### [](#取得元)取得元

DataWeave スクリプトは、YAML エンコードされた入力ペイロードを DataWeave (dw) 形式および MIME タイプに変換します。

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

### [](#出力)出力

次の出力は、YAML 入力が DataWeave (​`dw`​) 形式でどのように表わされるかを示しています。

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

## [](#properties)Configuration のプロパティ

DataWeave では、YAML 形式に対して次の設定プロパティがサポートされます。

### [](#reader-のプロパティ)Reader のプロパティ

YAML 形式は、入力データを読み取るための指示を提供するプロパティを受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 50.0002%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">パラメーター</th>
<th class="tableblock halign-left valign-top">型</th>
<th class="tableblock halign-left valign-top">デフォルト</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>maxEntityCount</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>1</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>エンティティ拡張の最大数。この制限は、Billion Laughs 攻撃 (サービス拒否攻撃) を回避するために指定します。</p>
</div></div></td>
</tr>
</tbody>
</table>

### [](#writer-のプロパティ)Writer のプロパティ

YAML 形式は、出力データを書き込むための指示を提供するプロパティを受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 16.6666%;">
<col style="width: 50.0002%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">パラメーター</th>
<th class="tableblock halign-left valign-top">型</th>
<th class="tableblock halign-left valign-top">デフォルト</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>bufferSize</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>Number</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>8192</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>ライターバッファのサイズ。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>deferred</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>Boolean</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>false</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>​<code>true</code>​ に設定すると、DataWeave は出力をデータストリームとして生成し、スクリプトの実行はそれがコンシュームされるまで延期されます。
  有効な値は、​<code>true</code>​ または ​<code>false</code>​ です。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>encoding</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>UTF-8</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>使用するライターのエンコード。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>skipNullOn</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>String</code></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">​<code>null</code></p></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>指定されたデータ構造の ​<code>null</code>​ 値をスキップします。有効な値は、​<code>arrays</code>​、​<code>objects</code>​、​<code>everywhere</code>​ です。プロパティを設定しない限り、ライターはこの値をスキップしません。</p>
</div></div></td>
</tr>
</tbody>
</table>

## [](#mime_type)サポートされる MIME タイプ

YAML 形式では、次の MIME タイプがサポートされます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 100%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">MIME タイプ</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>application/yaml</code>​</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text/yaml</code>​</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>application/x-yaml</code>​</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>text/x-yaml</code>​</p></td>
</tr>
</tbody>
</table>