Skip to main content

I am on Section 2.3 of Dataweave Learn. 

 

Here is the output: 

{ 

  "string": "String", 

  "number": "Number", 

  "boolean": "Boolean" 

} 

 

How can I modify this script to get the output above: 

%dw 2.0 

output json 

--- 

{ 

  "string": "hello", 

  "number": 1, 

  "boolean": true 

}    

6 respuestas
  1. Khyati Mehta (InfinySkills) Forum Ambassador
    21 ago 2025, 13:02

    You need to replace the actual values with their data type names as strings. I think this should work:

    %dw 2.0

    output json

    ---

    {

    string: "String",

    number: "Number",

    boolean: "Boolean"

    }

0/9000