{"action":"opened","issue":{"url":"https://api.github.com/repos/netmod-wg/yang-next/issues/74","repository_url":"https://api.github.com/repos/netmod-wg/yang-next","labels_url":"https://api.github.com/repos/netmod-wg/yang-next/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/netmod-wg/yang-next/issues/74/comments","events_url":"https://api.github.com/repos/netmod-wg/yang-next/issues/74/events","html_url":"https://github.com/netmod-wg/yang-next/issues/74","id":426602789,"node_id":"MDU6SXNzdWU0MjY2MDI3ODk=","number":74,"title":"Support for unique leaf (or leaf combo) in a list of lists","user":{"login":"Reshad-Rahman","id":5272591,"node_id":"MDQ6VXNlcjUyNzI1OTE=","avatar_url":"https://avatars3.githubusercontent.com/u/5272591?v=4","gravatar_id":"","url":"https://api.github.com/users/Reshad-Rahman","html_url":"https://github.com/Reshad-Rahman","followers_url":"https://api.github.com/users/Reshad-Rahman/followers","following_url":"https://api.github.com/users/Reshad-Rahman/following{/other_user}","gists_url":"https://api.github.com/users/Reshad-Rahman/gists{/gist_id}","starred_url":"https://api.github.com/users/Reshad-Rahman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Reshad-Rahman/subscriptions","organizations_url":"https://api.github.com/users/Reshad-Rahman/orgs","repos_url":"https://api.github.com/users/Reshad-Rahman/repos","events_url":"https://api.github.com/users/Reshad-Rahman/events{/privacy}","received_events_url":"https://api.github.com/users/Reshad-Rahman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-03-28T16:52:49Z","updated_at":"2019-03-28T16:52:49Z","closed_at":null,"author_association":"NONE","body":"If I have a list which has a container, I can specify a leaf to be unique or a combination of leaf nodes to be unique. e.g.:\r\n    list a-list-of-containers {\r\n      key \"name\";\r\n      unique \"attr1 attr2\";\r\n      unique \"cont1/attr1 cont1/attr2\";\r\n      unique \"attr1 cont1/attr2\";\r\n      leaf name {\r\n        type string;\r\n      }\r\n\r\n      leaf attr1 {\r\n        type int32;\r\n      }\r\n      leaf attr2 {\r\n        type string;\r\n      }\r\n      container cont1 {\r\n        leaf attr1 {\r\n          type int32;\r\n        }\r\n        leaf attr2 {\r\n          type string;\r\n        }\r\n      }\r\n    }\r\n\r\nIf I  have a list of lists, I know of no way to have a leaf inside the lower list to be delcared unique across all lists. In the example below, let's say I want to define the leaf sin (social insurance number) to be unique across all provinces.\r\n\r\n    list a-list-of-lists {\r\n      key \"province\";\r\n\r\n      leaf province {\r\n        type string;\r\n      }\r\n      list employees {\r\n        key \"sin\";\r\n\r\n        leaf sin {\r\n          type int32;\r\n        }\r\n      }\r\n    }\r\n\r\nI tried with leafref but failed, however maybe I didn't try hard enough.\r\n"}}
{"actor":{"display_login":"Reshad-Rahman"}}