0

What is the correct way of specifying constraints and the defaults for the "map" type? I.e., is there is an option of specifying "valid_values" for both: keys and values? When we specify constraints at the "entry_schema" level, are they considered for keys, values, for both? Can we have separate lists of valid_values - one for keys and one for values? Or should we specify them both in a single list like in the following example?

properties:
        <property_name>:
               type: map
               entry_schema:
                       type: string
                       constraints:
                               - valid_values:
                                      - "key1":"val1"
                                      - "key2":"val2"
                                      - "key3":"val3"
                                      - "key4":"val4"
               default:           
                       key1: "val1"
                       key2: "val2"
flyx
  • 35,506
  • 7
  • 89
  • 126
Michael
  • 357
  • 2
  • 12
  • Where is the list? I only see scalars, mappings and sequences in your YAML file. – Anthon Mar 27 '17 at 18:42
  • What list do you mean? It is a map type. Each entry of the map should be a (key,value) pair. – Michael Mar 27 '17 at 22:04
  • By "a single list" I meant a single list of valid_values where each list entry will contain both keyname and a value (e.g., "key1:val1"). – Michael Mar 28 '17 at 02:13

0 Answers0