This module provides resources for registering a new data format for the DataWeave language.
For an example, see Custom Data Formats Example.
Types
DataFormat
Represents the DataFormat definition.
Definition
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ /**
* True if this is data format is represented as binary representation instead of text. False if not present.
**/
binaryFormat?: Boolean, /**
* Default character set of this format, if any.
**/
defaultCharset?: String, /**
* Returns the list of file extensions with the `.` (for example, `.json`, `.xml`) to assign to this data format.
**/
fileExtensions?: Array<String>, /**
* The list of MIME types to accept.
**/
acceptedMimeTypes: Array<MimeType>, /**
* Function that reads raw content and transforms it into the canonical DataWeave model.
**/
reader: (content: Binary, charset: String, settings: ReaderSettings) -> Any, /**
* Function that writes the canonical DataWeave model into binary content.
**/
writer: (value: Any, settings: WriterSettings) -> Binary }
EmptySettings
Represents a configuration with no settings.
Definition
1
Object
EncodingSettings
Represents encoding settings.
Definition
1
2
3
4
{ /**
* Encoding that the writer uses for output. Defaults to "UTF-8".
**/
encoding?: String {defaultValue: "UTF-8"} }
MimeType
Represents a MIME type, such as application/json
.
Definition
1
String
Settings
Reader or writer configuration settings.
Definition
1
Object