3.1The basic structure
A DataWeave script usually looks like:
%dw 2.0
output application/json
---
{
firstName: payload.firstName,
lastName: payload.lastName
}
Three pieces:
%dw 2.0
↑ language/version
output application/json
↑ output format
---
↑ separates header from transformation
{ ... }
↑ actual expression
The part after --- is essentially:
“What should the output become?”