Lists

Validation Rules for lists—value lists, value matrices, and section lists—are defined in two distinct layers:

  • List-level constraints — defined in the main node-rules definition and applied to the list as a whole (for example, the number of entries or optionality).

  • Entry-level rules — defined in a vr_entry subsection (or section list) and applied individually to each list entry.

This separation keeps list validation predictable and makes complex structures easier to reason about.

[app.tags]
type: "ValueList"
maximum: 10

[app.tags.vr_entry]
type: "text"
minimum: 1
maximum: 60

[app.user]
type: "SectionList"

[.vr_entry.full_name]
type: "text"

[.vr_entry.email]
type: "text"
[app]
tags: "red", "orange", "yellow", "green", "blue"

*[app.user]*
full_name: "Example User 1"
email: "[email protected]"

*[app.user]*
full_name: "Example User 2"
email: "[email protected]"

Common Rules for vr_entry

  1. Regular Node-Rules Semantics: A vr_entry definition behaves like a regular Node-Rules definition.

    All rules that apply to node-rules definitions—such as constraints, defaults, alternatives, and documentation fields—also apply to vr_entry.

    The only difference is that the allowed type values depend on the parent list type.

    [app.tags]
    type: "ValueList"
    maximum: 10
    
    [app.tags.vr_entry]
    type: "text"
    minimum: 1
    maximum: 60
    
  2. Alternatives Allowed: A vr_entry definition may itself be a section list, enabling the use of alternatives for list entries.

    [ruler.marks]
    type: "ValueList"
    maximum: 15
    
    *[.vr_entry]*
    type: "integer"
    
    *[.vr_entry]*
    type: "float"
    

Rules for Value Lists and Matrices

Please also refer to About Value Lists and Matrices for details on how value lists and value matrices are represented and interpreted.

  1. Mandatory vr_entry: A node-rules definition for a value list or value matrix must include a vr_entry subsection.

    [app.tags]
    type: "ValueList"
    maximum: 10
    
    # ERROR: "app.tags.vr_entry" is missing
    
  2. Scalar Entries Only: The vr_entry definition for a value list or value matrix is limited to scalar values.

    Nested lists or sections are not permitted as list entries.

    [server.ports]
    type: "ValueList"
    maximum: 5
    
    [.vr_entry]
    type: "integer"
    minimum: 1
    maximum: 65534
    

Rules for Section Lists

  1. Mandatory vr_entry: A node-rules definition for a section list must include a vr_entry subsection.

    The vr_entry rules describe the structure and constraints of each section in the list.

    [app.user]
    type: "SectionList"
    
    [.vr_entry.full_name]
    type: "text"
    
    [.vr_entry.email]
    type: "text"
    
  2. Section-Type Entries: The vr_entry definition for a section list must define a section or a section-with-texts.

    Implicit sections are allowed and commonly used.

    [app.user]
    type: "SectionList"
    
    # "vr_entry" is implicitly defined as a section.
    
    [.vr_entry.full_name]
    type: "text"
    
    [.vr_entry.email]
    type: "text"