| Internet-Draft | anydata validation | October 2026 |
| Elhassany & Graf | Expires 2 May 2027 | [Page] |
The YANG "anydata" statement carries data whose data model is not known when the module is designed. This document defines the context that is needed to validate such content: the schema context, the "anydata" node, a schema anchor, and the datastore. It describes how this context is obtained for the uses of "anydata" in IETF YANG modules, how the schema node of each node in the content is found, and which YANG constraints are checked.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 2 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Section 7.10 of [RFC7950] defines the "anydata" statement to represent an unknown set of nodes that can be modeled with YANG, but whose data model is not known at module design time. The same section notes that the data model for anydata content can become known through protocol signaling or other means and leaves those means out of scope nor requires them.¶
Many IETF YANG modules use "anydata" (see Section 3), including [RFC8040], [RFC8072], [RFC8526], [RFC8639], [RFC8641], [RFC9144], and [RFC9195]. In most of these uses, the content is not arbitrary: the defining document states in prose that it is YANG instance data from a YANG datastore, instantiated from the same modules the producer implements. When a server receives such content as input, for example the value of a YANG Patch edit, it validates the content against its own schema and datastore as part of processing the operation. When anydata content is produced as output, however, for example in YANG-Push notifications or the reply to a datastore comparison, no such step exists on the receiving side. Current YANG implementations accept any well-formed, namespace-qualified content there and do not validate it against any YANG schema: not data types or ranges, and not "mandatory", "min-elements", "must", or "when" constraints. Even input is not always validated: YANG configuration templates [I-D.tt-netmod-yang-config-templates] store reusable configuration as anydata content in <running>, and because that content is opaque to the server, it cannot be validated when the template is defined, only once the template is expanded.¶
That gap has become significant because anydata output is no longer consumed only by the client that requested it. For instance, network operators collect YANG-Push notifications from thousands of network nodes and forward them through message brokers into analytics pipelines [I-D.ietf-nmop-yang-message-broker-integration]. The components that consume this data are decoupled from the producer, have no protocol session through which to learn its schema, and process the data long after it was sent. For example, the "in-octets" counter of [RFC8343] is of type "yang:counter64". If a network node with a software defect sends a YANG-Push update with a negative value for this counter, a consumer that validates the anydata content against the producer's schema rejects the value as a type violation. A consumer that cannot validate accepts it, and an analytics component that sums interface counters across the network computes a wrong traffic volume, which can lead to inaccurate billing or capacity planning. Such errors are costly to trace back to their source once the data has left the collection layer.¶
Validating anydata content requires four pieces of context, none of which can be derived from the content alone:¶
Existing mechanisms do not provide this context. YANG Schema Mount [RFC8528] mounts complete data models at a fixed point of the schema tree and cannot describe an arbitrary subset of an instantiated data tree, such as one selected by a YANG-Push subscription filter. YANG Full Embed [I-D.jouqui-netmod-yang-full-include] complements Schema Mount at module design time but has the same limitation. A design-time substatement of "anydata" could declare that the content of a node is expected to be valid YANG instance data, but it cannot carry the schema anchor or the datastore, because both are often known only at run time, for example when a YANG-Push subscription is established.¶
This document therefore defines the validation context of an anydata node: the four inputs listed above, how each one is obtained for the uses of "anydata" surveyed in Section 3, how the schema node of each node in the content is found, and which constraints are checked under each option. Today, each implementation that validates anydata content defines its own way to receive this context. Other specifications that use "anydata" can state how their content is validated by referencing this document. How the validation context is conveyed to a validator is outside the scope of this document. This document does not change the "anydata" statement, does not constrain how YANG modules use "anydata", and does not require any existing client or server to perform validation.¶
Validation remains optional and is a decision of the consumer. A consumer that detects non-conforming content can, for example, discard the message, log it for further analysis, or alert an operator, instead of passing incorrect data on to the systems that depend on it.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses the terms data node, data tree, instance identifier, schema node, and schema tree as defined in [RFC7950]; datastore, datastore schema, conventional configuration datastore, operational state datastore (<operational>), client, server, and notification as defined in [RFC8342]; and event record, event stream, publisher, and receiver as defined in [RFC8639].¶
The following terms are defined in this document:¶
This section lists the "anydata" nodes defined in published IETF YANG modules and in active Internet-Drafts at the time of writing. For each use it records four facts that a validator needs and that the defining document either states or leaves open:¶
Table 1 lists the anchor, the datastore and whether the content is a fragment for each use. The subsections that follow group the uses by purpose and describe their schema context.¶
| Document | "anydata" node | Anchor | Datastore | Fragment |
|---|---|---|---|---|
| RFC 8526 | get-data input subtree-filter | root | "datastore" input leaf | yes |
| RFC 8526 | get-data output data | root | "datastore" input leaf | may |
| RFC 8526 | edit-data input config | root | "datastore" input leaf (configuration datastore) | yes |
| RFC 8072 | yang-patch edit value | content relative to edit "target" | datastore of the PATCH target resource | yes |
| RFC 9144 | compare input subtree-filter | root | "source" and "target" input leaves | yes |
| RFC 9144 | compare output edit value and source-value | content relative to edit "target" | "target" and "source" datastores respectively | yes |
| RFC 8639 | stream-subtree-filter | "/" (first-level node is a notification) | none (event stream) | yes |
| RFC 8641 | datastore-subtree-filter | root | subscription's target datastore | yes |
| RFC 8641 | push-update datastore-contents | root | subscription's target datastore | may |
| RFC 8641 | push-change-update yang-patch edit value | content relative to edit "target" | subscription's target datastore | yes |
| RFC 9195 | content-data | root | not specified | may |
| RFC 9195 | inline-yang-library | root | none (fixed schema: ietf-yang-library) | no |
| RFC 8040 | errors error error-info | not specified | none | unknown |
| RFC 8532 | test point root (schema mount point) | root of the mounted schema | as for the parent data tree | no |
| YANG Templates | template content | "data-path" leaf (any level) | <running>, or <system> | yes |
| Notif. Envelope | envelope contents | "/" (first-level node is a notification) | none (event stream) | no |
| YANG-Push 2 | filter subtree | root | subscription's target datastore | yes |
| YANG-Push 2 | update merge and replaced-by | content relative to "path-prefix" plus "target-path" | subscription's target datastore | yes |
| Telemetry Message | message payload | "/" (first-level node is a YANG-Push notification) | none; nested "datastore-contents" uses the subscription's target datastore | may |
| Telemetry Message | label anydata-values | not specified | none | unknown |
| Telemetry Message | subscription subtree-filter | "/" (first-level node is a data node or a notification) | as for the subscription | yes |
Subtree filters (Section 6 of [RFC6241]) are carried in "anydata" by [RFC8526], [RFC9144], [RFC8641] and [I-D.ietf-netconf-yang-push-2], where they select a subtree of a datastore, and by [RFC8639], where they select event records from an event stream. In the datastore case the anchor is the datastore root of the datastore named by the operation or the subscription. In the event stream case the top-level node is a notification, whose schema is defined by a "notification" statement in the publisher's YANG Library; the content is therefore not undefined YANG-like data.¶
A subtree filter is a pattern, not instance data: selection nodes are empty, containment nodes may omit list keys, and mandatory nodes are usually absent. Only the node names, and the values of content match nodes, can be checked against the schema.¶
The "data" output of get-data [RFC8526] and the "datastore-contents" of push-update [RFC8641] carry the part of a datastore that matched a selection filter, anchored at the datastore root. The schema and the validation rules are those of the selected datastore: content from <operational> includes "config false" nodes and may carry origin metadata [RFC7952], and it need not satisfy constraints that apply only to configuration datastores (Section 5.3 of [RFC8342]).¶
The edit-data operation [RFC8526] carries configuration anchored at the datastore root, together with operation metadata, and the server validates the result.¶
YANG Patch [RFC8072] carries the new content of each edit in the "value" node. The top-level node of "value" is an instance of the data node identified by the "target" leaf. "target" is an absolute path when the PATCH request targets the datastore resource and a path relative to the target resource otherwise (Section 2.4 of [RFC8072]). The anchor is therefore the parent of the target data node, and it is only known after "target" is resolved. The anchor is kept as an instance path with its list key values: the schema node is found by ignoring the keys, and the keys identify the ancestor instances of the content, so that references from the content to its ancestors can be evaluated.¶
The YANG Patch structure is reused by push-change-update [RFC8641] to report on-change updates of the subscription's target datastore, and by the compare operation [RFC9144] to report differences. RFC 8641 and RFC 9144 do not state the base of "target"; their examples use absolute paths. In RFC 9144, one edit carries content from two datastores: "value" from the target datastore and "source-value", an augmentation, from the source datastore. The two nodes of the same edit can therefore be subject to different datastore rules, for example <intended> and <operational>.¶
The update notification of [I-D.ietf-netconf-yang-push-2] carries "merge" and "replaced-by" content relative to the path formed by a common "path-prefix" and a per-update "target-path".¶
YANG Instance Data [RFC9195] stores a data tree in "content-data", anchored at the root, and states that the data MUST conform to the YANG modules given in "content-schema". The schema context is given as a list of modules, as an inline YANG Library in the "inline-yang-library" node, or as a reference to another instance data file. RFC 9195 thus already describes the schema of "anydata" content with YANG Library. The "inline-yang-library" node is itself "anydata" whose schema is fixed by its description (ietf-yang-library revision 2019-01-04).¶
YANG Configuration Templates [I-D.tt-netmod-yang-config-templates] store template content as "anydata" in <running>, or in <system> where supported. A "data-path" leaf anchors the content at any location of the schema tree, defaulting to the root. Servers SHOULD validate a template when it is defined and MUST validate it when it is applied, but a template need not contain mandatory nodes, so definition-time validation cannot apply all constraints.¶
The notification envelope [I-D.ietf-netconf-notif-envelope] carries the content of a notification in the "contents" node of a YANG structure [RFC8791]. The name and namespace of the top-level node are those of the module that defines the notification, so the content can be validated against the publisher's YANG Library; it is not datastore content.¶
The telemetry message [I-D.ietf-nmop-message-broker-telemetry-message] carries the message received from a network element in the "payload" node. The payload is a YANG-Push notification [RFC8641], so its first-level node is that notification, under the root "/". The "datastore-contents" inside the notification is a nested "anydata" node with its own validation context: its anchor is again "/", and its datastore is the subscription's target datastore. The subscription metadata identifies that datastore and the filter, and can identify the publisher's YANG Library through "yang-library-content-id". Unlike most uses, the message thus carries the schema context and the datastore together with the content. Operator labels may also carry "anydata" values whose schema is not defined.¶
RESTCONF [RFC8040] uses "error-info" to convey additional error information as a container of data nodes. Neither the anchor nor the schema of that information is defined by RESTCONF or signaled in the response.¶
The connectionless OAM model [RFC8532] defines an "anydata" node named "root" with the "mount-point" extension of [RFC8528], so that technology-specific modules can be mounted under each test point. The mounted schema is described by the schema mount data, which includes YANG library data for the mount point (Section 3.3 of [RFC8528]). The content is validated against that mounted schema, with the root of the mounted schema as the anchor. Section 3.1 of [RFC8528] allows "mount-point" only as a substatement of "container" and "list".¶
To validate "anydata" content, a validator first has to find, for each instantiated data node in the content, the schema node it is an instance of. This section defines that lookup. It uses the four inputs of the validation context: the schema context, the "anydata" node, the schema anchor, and the datastore.¶
Below the first level of the content, no new rule is needed. Each encoding already identifies a child node relative to its parent (Section 7 of [RFC7950], Section 4 of [RFC7951], Section 3 of [RFC9254]). What the encodings do not define is the parent of the first-level nodes. This document uses the schema anchor as that parent.¶
When the content is encoded from the top of the data tree, the schema anchor is the root of the schema tree, written "/". Otherwise, the anchor is a container, a list, a notification, or the input or output of an RPC or action.¶
The anchor is represented as a node-instance-identifier ([RFC8341]): an instance-identifier in which key predicates are optional. The validator removes the key predicates and resolves the remaining path to a schema node. Choice and case nodes do not appear in the path, as in any instance-identifier. When the key predicates are present, the validator can also instantiate the ancestors of the content, including their list keys. This allows "must", "when", and leafref expressions in the content that refer to ancestor nodes to be evaluated. When they are absent, the ancestors cannot be instantiated: which list entry the content belongs to is unknown, so a reference that leaves the content through an ancestor cannot be resolved. Such references are treated as references to nodes outside the content (see Section 5). The lookup itself does not need the key predicates.¶
The anchor changes where the first-level nodes are looked up. It does not change the root of the data tree. Absolute paths that appear in the content or in its schema, such as leafref "path" statements, "must" and "when" expressions, and instance-identifier values, are evaluated from the root of the data tree, as defined in Section 6.4.1 of [RFC7950]. In this respect the anchor differs from a schema mount point, under which paths are interpreted with the mount point as the root node (Section 4 of [RFC8528]).¶
Defining documents identify the anchor in one of two ways:¶
A path carried with the content identifies the instance that the content is, for example the "target" of a YANG Patch edit [RFC8072]. The first-level node of the content is an instance of the schema node identified by the path, and the anchor is the parent of that schema node. A path of "/" is handled as defined by the document that carries it.¶
The "target" of [RFC8072], which [RFC8641] and [RFC9144] reuse, is not an instance-identifier. Its type, "target-resource-offset", is encoded as a data resource identifier of a RESTCONF request URI (Section 3.5.3 of [RFC8040]), for example "/song=Dear%20Rosemary". The validator converts such a path to the JSON encoding of an instance-identifier (Section 6.11 of [RFC7951]), which uses the same rule for module names: each "list=key1,key2" step becomes the list name followed by one key predicate per key, in the order of the list's "key" statement, and each key value is percent-decoded. When the target is relative to the target resource (Section 2.4 of [RFC8072]), the path of the target resource is converted in the same way and prepended.¶
In both cases, the anchor is a property of an instance of the "anydata" node, not of the "anydata" schema node. For example, each edit of a YANG Patch carries its own "target", and therefore the "value" of each edit has its own anchor.¶
At the root anchor, a first-level node is either a top-level data node or a top-level notification. When the validation context names a datastore, the first-level nodes MUST be data nodes. When the content is an event record from an event stream, as in [RFC8639] and [I-D.ietf-netconf-notif-envelope], the first-level node MUST be a notification.¶
A validator performs the lookup for one instance of an "anydata" node as follows:¶
The XML encoding needs no additional rule. The value of an "anydata" node is a set of nodes encoded as subelements of the "anydata" element (Section 7.10.2 of [RFC7950]), and the namespace of each subelement is the XML namespace of the module that defines the node. The namespace of every element is resolved by the XML namespace rules, including declarations inherited from ancestor elements. A first-level element without its own namespace declaration therefore inherits the default namespace in scope at the "anydata" element, which is usually the namespace of the module that defines the "anydata" node.¶
The namespace declarations in scope at the "anydata" element also apply to prefixes used in values of the content, such as identityref and instance-identifier values (Section 9.10.3 of [RFC7950], Section 9.13.2 of [RFC7950]). A validator that extracts the content from the message MUST preserve these declarations.¶
A member name is either namespace-qualified or simple, and a simple name belongs to the module of its parent node (Section 4 of [RFC7951]). The content of an "anydata" node follows the same rules (Section 5.5 of [RFC7951]). For the first-level members, the anchor takes the role of the parent node. This matches the YANG Patch examples, where an edit whose target is a list entry of the target resource carries the list with a simple member name (Appendix A.1.2 of [RFC8072]), and an edit whose target is in the datastore carries a namespace-qualified name (Appendix A.1.5 of [RFC8072]). Therefore:¶
When the content of an "anydata" node (Section 4.5 of [RFC9254]) uses names as map keys, the rules for JSON above apply, as Section 3.3 of [RFC9254] uses the same qualification rule as JSON.¶
When the content uses YANG Schema Item iDentifiers (SIDs) [RFC9595] as map keys, the reference SID of the first-level map is determined by Section 3.2 of [RFC9254]: it is the SID of the "anydata" node, or zero if the "anydata" node is encoded with a name as its key. A first-level key can also be an absolute SID (tag 47). Because a SID identifies a schema node independently of its position, the anchor is not needed to identify the node. The validator MUST check that the identified schema node is a child of the anchor. When SIDs are used, the schema context includes the SID assignments of its modules.¶
For each use of "anydata" listed in Section 3, the anchor is obtained as follows.¶
| Use | Anchor | Way |
|---|---|---|
| get-data output "data" and edit-data input "config" [RFC8526]; "content-data" [RFC9195]; push-update "datastore-contents" [RFC8641] | "/" | fixed |
| YANG Patch edit "value" [RFC8072] | the edit's "target", relative to the target resource unless the target resource is the datastore (Section 2.4 of [RFC8072]) | Target |
| push-change-update edit "value" [RFC8641] | the edit's "target" | Target |
| compare output edit "value" and "source-value" [RFC9144] | the edit's "target" | Target |
| update "merge" and "replaced-by" [I-D.ietf-netconf-yang-push-2] | "path-prefix" followed by "target-path" | Target |
| template "content" [I-D.tt-netmod-yang-config-templates] | "data-path" | Location |
| envelope "contents" [I-D.ietf-netconf-notif-envelope]; telemetry message "payload" [I-D.ietf-nmop-message-broker-telemetry-message] | "/" (a notification) | fixed |
| subtree filters: get-data [RFC8526], compare [RFC9144], "datastore-subtree-filter" [RFC8641], filter "subtree" [I-D.ietf-netconf-yang-push-2], subscription "subtree-filter" [I-D.ietf-nmop-message-broker-telemetry-message] | "/" | fixed |
| "stream-subtree-filter" [RFC8639] | "/" (a notification) | fixed |
| "inline-yang-library" [RFC9195] | "/", with ietf-yang-library revision 2019-01-04 as the schema context | fixed |
| test point "root" [RFC8532] | root of the mounted schema; the schema context is the mounted YANG library data (Section 3.3 of [RFC8528]) | fixed |
| "error-info" [RFC8040]; label "anydata-values" [I-D.ietf-nmop-message-broker-telemetry-message] | not defined | none |
A subtree filter is a pattern, not instance data (Section 6 of [RFC6241]): its nodes are looked up as defined here, but only node names and the values of content match nodes can be checked. Where the defining document gives no anchor and no schema, as for "error-info" and the telemetry message labels, the content is not validated.¶
Neither [RFC8641] nor [RFC9144] states what the "target" of an edit is relative to; their examples use absolute paths, and this document assumes absolute paths for both. In [RFC9144], "value" and "source-value" of the same edit share the anchor but come from different datastores, so each is validated with its own validation context.¶
A selection filter does not change the anchor. A subtree filter can select several subtrees of a datastore (Section 3.6 of [RFC8641]), and an XPath filter can select any node set, but the selected data is still encoded from the root of the data tree. One root anchor therefore covers all selected subtrees, and the nodes that the filter left out are handled by the option chosen in Section 5. None of the surveyed uses encodes, in one instance of an "anydata" node, first-level nodes that are children of different schema nodes, so a single anchor per instance is sufficient.¶
Metadata annotations [RFC7952] attached to nodes in the content, such as the "origin" annotation of <operational>, are resolved in the schema context like any other annotation. This document defines no new annotations. The validation context applies to the whole content of one "anydata" instance and is known when the content is produced; it is not a property of individual nodes. The uses surveyed in Section 3 already carries the anchor and the datastore next to the "anydata" node, in the YANG Patch target, the template data-path, or the subscription, so an annotation would duplicate them. An annotation remains possible for a use that carries neither, and this document does not preclude one.¶
The lookup of one instance of an "anydata" node ends in one of three outcomes:¶
A validator reports errors with the "error-tag" values of Appendix A of [RFC6241], as listed in Table 3.¶
| Case | Outcome | error-tag |
|---|---|---|
| The namespace or module name of a node is not in the schema context | invalid | unknown-namespace |
| The module is in the schema context but not implemented, or the node is removed by a feature or deviation | invalid | unknown-element |
| The schema node exists, but not as a child of the anchor or of the parent node | invalid | unknown-element |
| A JSON or CBOR member name is not a valid name, or is simple at the root anchor | invalid | bad-element |
| An instance of an "anyxml" node | invalid | bad-element |
| The anchor cannot be resolved | not validated | none |
| Nested "anydata" without a validation context, or a mounted schema that is not available | not validated (subtree) | none |
This section defines how a validator checks "anydata" content once the schema lookup of Section 4 has found a schema node for every node in it. It does not define new constraints. It selects which of the constraints of Section 8.1 of [RFC7950] are checked, using two options: anydata-complete and anydata-candidate. The consumer chooses the option for each instance of an "anydata" node; this document does not define a default.¶
Section 8.1 of [RFC7950] separates the properties that are true in all data trees from the properties that are true in a valid data tree. A configuration datastore that is not yet committed, such as <candidate>, satisfies the first set at all times and the second set only when it is validated (Section 8.3.3 of [RFC7950]). The two options follow this split.¶
The validator checks every node of the content against its schema node:¶
"must", "when", "unique", "mandatory", "min-elements", and "max-elements" statements are not checked, and leafref and instance-identifier references are not required to resolve. Evaluating "when" can require nodes that are not part of the content, so it is not checked under this option even though Section 8.1 of [RFC7950] lists it among the properties of all data trees.¶
The validator performs all checks of anydata-candidate and, in addition, checks every property that Section 8.1 of [RFC7950] requires of a valid data tree: "when", "must", "unique", "mandatory", "min-elements", and "max-elements", and the referential integrity of leafref and instance-identifier values whose "require-instance" is "true".¶
The content is treated as self-contained. Expressions and references are evaluated on a data tree that consists of the ancestors instantiated from the schema anchor (Section 4.1) and the content. A reference to a node that is not in this data tree is not satisfied.¶
The anydata-complete option is intended for content that is complete for its schema anchor, such as the full reply to a get-data operation [RFC8526] on <running> or a YANG instance data file [RFC9195]. Content that is a fragment, such as the output of a subscription filter, a YANG Patch edit, or a configuration template, is expected to fail anydata-complete, and so is content from <operational>, in which semantic constraints may be violated (Section 5.3 of [RFC8342]). Such content is validated with anydata-candidate.¶
A validator can use additional instance data of the datastore, such as a copy of it, to resolve references that leave the content. The content is then validated as part of that data tree. How such data is obtained is outside the scope of this document. Without such data, a reference to a node that is not in the data tree formed by the ancestors of the schema anchor and the content is not satisfied under anydata-complete and is not checked under anydata-candidate.¶
A validator validates one instance of an "anydata" node as follows:¶
A validator MUST support both options and MUST follow this procedure. A validator MUST NOT report content as invalid because context needed for the lookup or for validation is missing.¶
Validation of one instance of an "anydata" node ends in one of the outcomes of Section 4.6: valid, invalid, or not validated. A result also names the option that was applied, and lists any subtrees that were not validated.¶
A validator reports errors with the "error-tag" and "error-app-tag" values that [RFC7950] already assigns to each violation, as listed in Table 4. The "error-path" is the path from the root of the data tree, including the ancestors instantiated from the schema anchor.¶
| Violation | error-tag | error-app-tag | Option |
|---|---|---|---|
| Value does not match its type (Section 8.3.1 of [RFC7950]) | invalid-value | from the restriction, if any | both |
| Missing key leaf (Section 8.3.1 of [RFC7950]) | missing-element | both | |
| More than one case branch (Section 8.3.1 of [RFC7950]) | bad-element | both | |
| Node with a false "if-feature" (Section 8.3.1 of [RFC7950]), or "config false" in a conventional configuration datastore | unknown-element | both | |
| Node with a false "when" (Section 8.3.1 of [RFC7950]) | unknown-element | complete | |
| "unique" (Section 15.1 of [RFC7950]) | operation-failed | data-not-unique | complete |
| "max-elements" (Section 15.2 of [RFC7950]) | operation-failed | too-many-elements | complete |
| "min-elements" (Section 15.3 of [RFC7950]) | operation-failed | too-few-elements | complete |
| "must" (Section 15.4 of [RFC7950]) | operation-failed | must-violation, unless the statement has its own | complete |
| Leafref or instance-identifier without instance (Section 15.5 of [RFC7950]) | data-missing | instance-required | complete |
| Mandatory choice (Section 15.6 of [RFC7950]) | data-missing | missing-choice | complete |
| Mandatory leaf | missing-element | complete |
What a consumer does with the outcome is outside the scope of this document. A consumer can, for example, pass valid content on, discard or quarantine invalid content and alert an operator, and pass on content that was not validated while counting it.¶
A YANG-Push subscription [RFC8641] to <operational> selects the interface statistics of [RFC8343]. The anchor of the "datastore-contents" node is "/", the datastore is <operational>, and the consumer chooses anydata-candidate. A network node with a software defect sends the following update:¶
<notification
xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
<eventTime>2026-10-09T10:00:00Z</eventTime>
<push-update xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push">
<id>1011</id>
<datastore-contents>
<interfaces
xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interface>
<name>eth0</name>
<statistics>
<in-octets>-4271233</in-octets>
</statistics>
</interface>
</interfaces>
</datastore-contents>
</push-update>
</notification>
¶
The lookup finds a schema node for every element. Step 3 checks the value of "in-octets" against its type, "yang:counter64", whose range is 0 to 18446744073709551615. The value is outside that range, so the outcome is invalid, with error-tag "invalid-value" and error-path "/if:interfaces/if:interface[if:name='eth0']/if:statistics/if:in-octets". Because the update is a fragment, anydata-complete would also report the missing mandatory "type" leaf with error-tag "missing-element", even though the content is a correct part of <operational>.¶
Note to the RFC-Editor: Please remove this section before publishing.¶
anydata-candidate validation is implemented for libyang and available at https://github.com/ahassany/libyang/tree/anydata-strict-parsing¶
This memo includes no request to IANA.¶
The authors would like to thank Jean Quilbeuf, Benoit Claise, and Alex Huang Feng for their review and valuable comments.¶