%dw 2.0
import * from dw::core::Types
type ArrayOfString = Array<String>
type ArrayOfNumber = Array<Number>
type ArrayOfAny = Array<Any>
type ArrayOfAnyDefault = Array
output application/json
---
{
a: arrayItem(ArrayOfString),
b: arrayItem(ArrayOfNumber),
c: arrayItem(ArrayOfAny),
d: arrayItem(ArrayOfAnyDefault)
}
DataWeave
arrayItem
arrayItem(t: Type): Type
Returns the type of the given array. This function fails if the input is not an Array type.
Introduced in DataWeave version 2.3.0.
Parameters
Name | Description |
---|---|
|
The type to check. |
Example
This example shows how arrayItem
behaves with different inputs.
Source
Output
{
"a": "String",
"b": "Number",
"c": "Any",
"d": "Any"
}
Json