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

Native Type Parameter validation should allow typing with Variant type (and others)

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: PUP 4.2.3
    • Fix Version/s: None
    • Component/s: Language
    • Template:
    • Team:
      Coremunity

      Description

      During parameter declaration, I would like the ability to state that a variable can be one of many types. This should allow validation under those types, but should not allow any type outside of the provided list.

      For example, there are many cases, particularly in native types, that allow input to be either a String or an Array. Additionally, the pattern of making a variable a Boolean or a String is fairly common. Finally, the alternative of using either an Array or a Hash is also reasonable (list vs additional detail).

      I'm aware that this can currently be worked around by not validating in the parameter declaration, but it would be nice to be able to do so for consistency.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                peiriannydd Trevor Vaughan
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: