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

Alex Martinez @devalexmartinez

About: Software Engineer with 10 years of experience in IT. I founded ProstDev and became a content creator. I liked it so much that I joined MuleSoft as a Developer Advocate.

Location:
Niagara Falls, Canada
Joined:
Apr 28, 2022

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

Publish Date: Feb 8 '23
0 0

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

Comments 0 total

    Add comment