Uploaded image for project: 'Service Design and Creation'
  1. Service Design and Creation
  2. SDC-4398

Incorrect behaviour for list valid values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • London Release
    • London Release
    • None
    • None

      When a list property has a valid_values constraint, then the list may contain any of the values in the constraint value, e.g. for the property:

            list_int_prop_with_valid_values:
              type: list
              required: false
              entry_schema:
                type: integer
              constraints:
              - valid_values:
                - 4
                - 7 

      all of the following are valid values:

      list_str_prop_with_valid_values: [4]
      list_str_prop_with_valid_values: [7]
      list_str_prop_with_valid_values: [4, 7]

       

      However the current validation of the constraint definition checks that each of the valid values in the definition (the integers 4 and 7 in this case) are of the same type as the property (list) and therefore fails.

      The constraint value validation for valid values needs to be updated to check the individual values in the valid_value definition against the schema of the list

      The same issue also exists for maps

            MichaelMorris Michael Morris
            MichaelMorris Michael Morris
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: