Search code examples
commentsanypoint-studiodataweavemule-esb

Anypoint Studio - DataWeave 1.0 - How to add comments?


Is it possible to add comments to our DataWeave v1.0 scripts in Anypoint Studio?


Solution

  • Yes. You can add a single-line comment:

    %dw 1.0
    %output application/java
    %namespace ns0 http://www.namespace.com/resource
    ---
    {   
        // This is a comment.
        id: payload.id
    }
    

    But be careful: comments are not allowed everywhere. For example; comments at the end of the file won't work at the moment.

    See also the related topic in the MuleSoft forum: Comments in DataWeave