Contact Us 1-800-596-4880

nameOf

nameOf(Type): String

Returns the name of the input type.

Introduced in DataWeave 2.3.0. Supported by Mule 4.3 and later.

Parameters

Name Description

t

The type to query

Example

This example shows how nameOf behaves with different inputs.

Source

%dw 2.0
output application/json
import * from dw::core::Types
type AArray = Array<String> {n: 1}
type AArray2 = Array<String>
---
 {
     a: nameOf(AArray),
     b: nameOf(AArray2),
     c: nameOf(String)
 }

Output

{
   "a": "AArray",
   "b": "AArray2",
   "c": "String"
 }