DEV Community

Alex Martinez
Alex Martinez

Posted on • Edited on

How to generate shareable link examples from GitHub to open in the DataWeave Playground

This is intended as a short guide. For detailed instructions + video, please see this article.

Prepare your GitHub repo

Inside the folder of your example, make sure you have the following folder structure:

folderExample/
  - inputs/
    - payload.json // or any other input files
  - transform.dwl // with your main script
  - // Add more .dwl files for custom modules
Enter fullscreen mode Exit fullscreen mode

Generate the link

Take this base URL to base your own link in:

https://dataweave.mulesoft.com/learn/playground?
projectMethod=GHRepo&
repo=<github-username>%2F<github-repo>&
path=<path-to-the-example>
Enter fullscreen mode Exit fullscreen mode

Note:

The %2F character is used to replace / to make the link url-safe.

Let's say that this folderExample was located in my alexandramartinez username and a dw-scripts repo. Then my URL would look like this:

https://dataweave.mulesoft.com/learn/playground?
projectMethod=GHRepo&
repo=alexandramartinez%2Fdw-scripts&
path=folderExample
Enter fullscreen mode Exit fullscreen mode

Real example

If you want to compare your link to a real example, take a look at this URL: https://dataweave.mulesoft.com/learn/playground?projectMethod=GHRepo&repo=alexandramartinez%2Fdataweave-scripts&path=functions%2FmaskFields

Which is based on this folder: https://github.com/alexandramartinez/dataweave-scripts/tree/main/functions/maskFields

Top comments (0)