Skip to content

Implement type constraints #149

Open

Description

@steiler

E.g. the following type has a limited value range, right now we do not honor this range.
https://github.com/nokia/srlinux-yang-models/blob/v24.3.2/srlinux-yang-models/srl_nokia/models/interfaces/srl_nokia-interfaces-vlans.yang#L105-L111

Is even a union:
https://github.com/nokia/srlinux-yang-models/blob/v24.3.2/srlinux-yang-models/srl_nokia/models/interfaces/srl_nokia-interfaces-vlans.yang#L175

Example data that makes it all the way to the device.

[
    {
        "path": "/",
        "value": {
            "interface": [
                {
                    "name": "ethernet-1/2",
                    "vlan-tagging": true,
                    "subinterface": [
                        {
                            "index": 6,
                            "vlan": {
                                "encap": {
                                    "single-tagged": {
                                        "vlan-id": 8000
                                    }
                                }
                            }
                        }
                    ]
                }
            ]
        }
    }
]

Activity

  1. steiler commented on Jun 5, 2026

    @steiler
    CollaboratorAuthor

    Validation for union-typed leaves (including branch-specific range / constraints) is tracked in PR #423.

  2. linked a pull request that will close this issueSupport Validation of union types #423on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions