---
schema_version: "1"
id: 6141bddc2a2a1034807d56505fb2eae7515948df5d373408630baa342ab564c4
title: DataFormat Types (dw::extension::DataFormat)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.4/dw-dataformat-types.md
canonical_url: https://docs.mulesoft.com/dataweave/2.4/dw-dataformat-types
source_site: docs.mulesoft.com
content_type: documentation
content_hash: c3d66404cc10f9bae1f4bd5bb23a5e60260690f26f0928fa030b3f21021d5e5c
description: MuleSoft Documentation Site
release: "2.4"
latest: false
---
---
product: DataWeave
version: 2.4
---

# DataFormat Types (dw::extension::DataFormat)

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

The DataFormat module provides resources for registering a new data format for the DataWeave
language. For an example, see
[Custom Data Formats Example](https://github.com/mulesoft-labs/data-weave-custom-data-format).

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Type</th><th>Definition</th><th>Description</th></tr></thead><tbody><tr><td><p>DataFormat</p></td><td><div><div><p><code>type DataFormat = { binaryFormat?: Boolean, defaultCharset?: String, fileExtensions?: Array&lt;String&gt;, acceptedMimeTypes: Array&lt;MimeType&gt;, reader: (content: Binary, charset: String, settings: ReaderSettings) -&gt; Any, writer: (value: Any, settings: WriterSettings) -&gt; Binary }</code></p></div></div></td><td><div><div><p>Represents the DataFormat definition.</p></div><div><ul><li><p><code>binaryFormat?: Boolean</code>: True if this is data format is represented as binary instead of text. False if not present.</p></li><li><p><code>defaultCharset?: String</code>: Default character set of this format, if any.</p></li><li><p><code>fileExtensions?: Array&lt;String&gt;</code>: Returns the list of file extensions with the <code>.</code> (for example, <code>.json</code>, <code>`.xml</code>) to assign to this data format.</p></li><li><p><code>acceptedMimeTypes: Array&lt;MimeType&gt;</code> The list of MIME types to accept.</p></li><li><p><code>reader: (content: Binary, charset: String, settings: ReaderSettings) → Any</code>: Function that reads raw content and transforms it into the canonical DataWeave model.</p></li><li><p><code>writer: (value:Any, settings:WriterSettings) → Binary</code>: Function that writes the canonical DataWeave model into binary content.</p></li></ul></div></div></td></tr><tr><td><p>EmptySettings</p></td><td><div><div><p><code>type EmptySettings = Object</code></p></div></div></td><td><div><div><p>Represents a configuration with no settings.</p></div></div></td></tr><tr><td><p>EncodingSettings</p></td><td><div><div><p><code>type EncodingSettings = { encoding?: String }</code></p></div></div></td><td><div><div><p>Represents encoding settings:</p></div><div><ul><li><p><code>encoding?: String</code>: Encoding that the writer uses for output. Defaults to "UTF-8".</p></li></ul></div></div></td></tr><tr><td><p>MimeType</p></td><td><div><div><p><code>type MimeType = String</code></p></div></div></td><td><div><div><p>Represents a MIME type, such as <code>application/json</code>.</p></div><div><p><em>Introduced in DataWeave version 2.2.0.</em></p></div></div></td></tr><tr><td><p>Settings</p></td><td><div><div><p><code>type Settings = Object</code></p></div></div></td><td><div><div><p>Reader or writer configuration settings.</p></div><div><p><em>Introduced in DataWeave version 2.2.0.</em></p></div></div></td></tr></tbody></table>
