Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4438

Add required_repeated_param to 4.x function API

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.8.1, PUP 4.1.0
    • Compiler, Docs
    • None
    • 1
    • Language 2015-04-29
    • New Feature

    Description

      It's currently not possible to specify a 'repeated_param' that is required in the 4.x. function API. An example of when this is needed is the defined() function. It requires at least one argument but may take several. Without the possibility to specify that at least one parameter must be present, this must be encoded as a required parameter followed by a 0:M related parameter. This does not really matter from an implementation standpoint (you have to write two parameters instead of one), but it matters from a UX perspective if there is an error; a user should perceive this as "one or more" rather than "one parameter, then zero or more additional parameters".

      The function API should add two new parameter declarations:

      optional_repeated_param  # alias for the current repeated_param
      required_repeated_param  # will set the minimum argument count to 1
      

      risk: medium
      probability: low (custom functions with optional repeated params)
      severity: medium (work arounds exist, UX issue)
      test layer: unit

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomas.hallgren Thomas Hallgren
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support