Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3492

Unable to use implicit iterator inside of a a section in mustache

    XMLWordPrintable

    Details

    • Story Points:
      5

      Description

      I am not able to use mustaches implicit iterator inside of a section

      I expect this snippet:

        bundle agent main
        {
            vars:
              "VAR" data => '{ "KEY": [ { "key": "value one" }, { "key": "value two" } ] }';
            reports:
               "$(with)" with => string_mustache( "{{#KEY}}{{#.}}{{key}}
        {{/.}}{{/KEY}}", VAR );
        }
      

      To emit (like the mustache demo https://mustache.github.io/#demo):

      R: value one
      value two
      

      Instead it emits:

      R:
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              a10042 Nick Anderson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel