Skip to content

Commit b380d17

Browse files
authored
Doc: update the list of data types + fix a typo (#2421)
Closes #2415
1 parent 0a59b32 commit b380d17

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

docs/dev/validation.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,21 @@ Validator recognizes standard Python data types (**str**, **int**, **bool**, **l
8787

8888
| Data type. | Meaning |
8989
|----------------|---------|
90-
| **asn** | AS number (an integer between 1 and 65535) |
90+
| **addr_pool** | [Address pool](address-pools) |
91+
| **asn** | AS number (2-octer or 4-octet) |
92+
| **asn2** | 2-octet ASN |
93+
| **bool_false** | The only valid value is *false* |
9194
| **device** | Valid device (platform) identifier |
9295
| **id** | Identifier (containing A-Z, a-z, 0-9 and underscore) |
9396
| **ipv4** | An IPv4 address, prefix, integer (offset in a subnet), or bool (unnumbered) |
9497
| **ipv6** | An IPv6 address, prefix, integer (offset in a subnet), or bool (LLA only) |
9598
| **mac** | MAC address in any format recognized by the `netaddr` library |
99+
| **named_pfx** | [named prefix](named-prefixes) |
96100
| **net** | IS-IS NET/NSAP |
97101
| **node_id** | Valid node name |
98102
| **prefix_str** | An IPv4 or IPv6 prefix |
99103
| **rd** | Route distinguisher (ASN:ID or IP:ID) |
104+
| **r_proto** | Routing protocol identifier |
100105

101106
The data type can be specified as a string (without additional parameters) or a dictionary with a **type** attribute (data type as a string) and other type-specific validation parameters.
102107

@@ -115,9 +120,11 @@ All attributes defined with a dictionary (**mode** in the above example, but not
115120

116121
* **true_value** -- value to use when the parameter is set to *True*
117122
* **_requires** -- a list of modules that must be enabled in global- or node context to allow the use of this attribute. See `vrfs` in `modules/vrf.yml` and `vlans` in `modules/vlan.yml` for more details.
118-
* **_required** (bool) -- the attribute must be present if the parent in the parent dictionary
123+
* **_required** (bool) -- the attribute must be present in the parent dictionary[^CRQ]
119124
* **_alt_types** -- [alternate data types](validation-alt-types)
120125

126+
[^CRQ]: This does not make the parent dictionary mandatory, but if it's present, it must have the required attribute. Use a chain of `_required` attributes if you want to enforce the presence of an attribute deep in the data structure.
127+
121128
See [](validation-definition-examples) for more details.
122129

123130
### Further Data Type Validation Options

0 commit comments

Comments
 (0)