Contact Us 1-800-596-4880

dataFormatsDescriptor

dataFormatsDescriptor(): Array<DataFormatDescriptor>

Returns an array of all DataFormatDescriptor values that are installed in the current instance of DataWeave.

Experimental: This function is an experimental feature that is subject to change or removal from future versions of DataWeave.

Example

This example shows how dataFormatsDescriptor behaves with different inputs.

Source

import * from dw::Runtime
---
dataFormatsDescriptor()

Output

[
      {
           "id": "json",
           "binary": false,
           "defaultEncoding": "UTF-8",
           "extensions": [
             ".json"
           ],
           "defaultMimeType": "application/json",
           "acceptedMimeTypes": [
             "application/json"
           ],
           "readerProperties": [
             {
               "name": "streaming",
               "optional": true,
               "defaultValue": false,
               "description": "Used for streaming input (use only if entries are accessed sequentially).",
               "possibleValues": [
                 true,
                 false
               ]
             }
           ],
           "writerProperties": [
             {
               "name": "writeAttributes",
               "optional": true,
               "defaultValue": false,
               "description": "Indicates that if a key has attributes, they are going to be added as children key-value pairs of the key that contains them. The attribute new key name will start with @.",
               "possibleValues": [
                 true,
                 false
               ]
             },
             {
              "name": "skipNullOn",
                 "optional": true,
                 "defaultValue": "None",
                 "description": "Indicates where is should skips null values if any or not. By default it doesn't skip.",
                 "possibleValues": [
                   "arrays",
                   "objects",
                   "everywhere"
                 ]
               }
             ]
           },
           {
             "id": "xml",
             "binary": false,
             "extensions": [
               ".xml"
             ],
             "defaultMimeType": "application/xml",
             "acceptedMimeTypes": [
               "application/xml"
             ],
             "readerProperties": [
               {
               "name": "supportDtd",
               "optional": true,
               "defaultValue": true,
               "description": "Whether DTD handling is enabled or disabled; disabling means both internal and external subsets will just be skipped unprocessed.",
               "possibleValues": [
                 true,
                 false
               ]
             },
             {
               "name": "streaming",
               "optional": true,
               "defaultValue": false,
               "description": "Used for streaming input (use only if entries are accessed sequentially).",
               "possibleValues": [
                 true,
                 false
               ]
             },
             {
               "name": "maxEntityCount",
               "optional": true,
               "defaultValue": 1,
               "description": "The maximum number of entity expansions. The limit is in place to avoid Billion Laughs attacks.",
               "possibleValues": [

               ]
             }
           ],
           "writerProperties": [
             {
               "name": "writeDeclaration",
               "optional": true,
               "defaultValue": true,
               "description": "Indicates whether to write the XML header declaration or not.",
               "possibleValues": [
                 true,
                 false
               ]
             },
             {
               "name": "indent",
               "optional": true,
               "defaultValue": true,
               "description": "Indicates whether to indent the code for better readability or to compress it into a single line.",
               "possibleValues": [
                 true,
                 false
               ]
             }
           ]
         }
]