DataWeave 2.x Playground coming to a container near you

Revealed at MuleSoft Connect 2020

Key take away’s

  • Learn to program in DataWeave 2.x with minimal resistance
  • Complete Read-Eval-Print-Loop (REPL) environment
  • Go from concepts to solutions at lightening speed

For some time now we’ve been enjoying the benefits of REPL environments provided by languages such as JSFiddle, Go Playground and Katacoda. Yet, we’ve been wondering when we might have something similar for DataWeave?

At the May 2020 MuleSoft Connect we got a glimpse of what may be on the horizon. In the Deep Dive Tips and Tricks presentation with Jason Johl, we learned about an early evaluation Docker release of a DataWeave Playground container where we can prototype and experiment with DW 2.x solutions. While still a little rough around the edges, it lightweight, easy to use, feature rich and hopefully on a trajectory to long term maturity.

Kicking tires on dw-playground

After the Docker image has downloaded and started up, point your browser to localhost port 9000, the playground DataWeave container.

DataWeave Playground

XML Input Payload

The DataWeave Playground allows you to define your inbound payloads which may be JSON, XML, CSV, TEXT, YAML and serveral other types. In the example above I created a transformation rule to extract all the data.number values in the input payload and render the output as a JSON array. The output transformation types are as rich and varied as the input types.

The other nice feature you can see in the lower panel, is the integration of DataWeave API guides and a log viewer.

Here are some additional DataWeave examples for you to play with in the playground:

DataWeave mapping from CSV to JSON

Mapping csv to json

Input CSV Payload (extra whitespace is ignored)

DataWeave mapping from JSON to XML

Input JSON Payload

That should be enough to help you get started with the DataWeave Playground, it’s a great tool which is easy to use and should help boost your productivity with MuleSoft.

--

--

is a techie enthusiast, who’s interests range from: building scalable secure systems to creating that favorite fermented beverage. He’s also an outdoors cat.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mitch Dresdner

is a techie enthusiast, who’s interests range from: building scalable secure systems to creating that favorite fermented beverage. He’s also an outdoors cat.