Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key of a list isn't mandatory #73

Closed
achernavin22 opened this issue Feb 13, 2019 · 1 comment
Closed

Key of a list isn't mandatory #73

achernavin22 opened this issue Feb 13, 2019 · 1 comment
Labels

Comments

@achernavin22
Copy link

There is a data model:

  +--rw host-config
     +--rw security
        +--rw host-acls
           +--rw host-acl* [acl-name]
              +--rw acl-name       string
              +--rw acl-seq        uint32
              +--rw description?   string

If you PUT /restconf/data/host-config this via RESTCONF, it will be accepted:

{
    "host-config": {
        "security": {
            "host-acls": {
                "host-acl": [
                    {
                        "acl-seq": 0
                    }
                ]
            }
        }
    }
}

If you PUT /restconf/data/host-config/security/host-acls/host-acl= this via RESTCONF, there will be a segfault:

{
	"host-acl": {
		"acl-seq": 0,
		"acl-name": ""
	}
}

The acl-seq leaf is explicitly mandatory and it is validated correctly.

@olofhagsand
Copy link
Member

Should be fixed now.
Thanks for reporting.
Problem here is that you can still add NULL keys via netconf - since validation is a separate step, but in cli or restconf it should not be possible.
This is the general problem of whether one should enforce all "must" constraints even before validation in candidate. I have chosen not to, but it can lead to some strange behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants