Skip to content

Consistent default value behavior for operations and validation #146

@abierman

Description

@abierman

YANG validation (e.g., must-stmt) sometimes depends on whether a "node exists in the accessible tree".
This creates a cornercase with the default-stmt

container npcon {
   leaf A { type string; }
   leaf B {
     must "../A = 'test1'";
     type int32;
     default 10;
   }
}

The issue is that every server can decide differently whether node /npcon/B is in the accessible tree.
It depends on with-defaults basic-style.

Each basic-style (trim, explicit, report-all) can have a different answer.
For report-all, this example would fail the must-stmt test when the module was loaded.
(Although our server does not do that since it would break some real deployments)

This also affects the 'create' and 'delete' operations in protocol operations.

Solution: not clear if YANG 2.0 can mandate a single behavior or find an alternative
to the 'node exists in the accessible tree' language

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions