Open szabolcsszekely opened 8 years ago
Hmm, this looks like an error in RFC 6110. I sort of assumed that schema node identifiers in unique argument only contain data nodes. In your example it would be
unique "parameter-1";
This would work, too, but apparently it is not what RFC 6020 (and now also 7950) says.
Hi, Do you have any update regarding this bug? Thanks, Szabolcs
No, not yet. Feel free to prepare a pull request.
Lada
Hi, Can you check this proposed correction? https://github.com/mbj4668/pyang/pull/434 thanks, Szabolcs
If I add a unique statement for a node inside a choice statement, the generated schema contains wrong path.
The error-message should be this: Violated uniqueness for "main:unique-test/main:a/main:parameter-1"
I think the problem is that the generated main-config.sch file contains this rule:
<sch:report test="preceding-sibling::main:my-list[main:unique-test/main:a/main:parameter-1=current()/main:unique-test/main:a/main:parameter-1]">Violated uniqueness for "main:unique-test/main:a/main:parameter-1"</sch:report>
instead of this:<sch:report test="preceding-sibling::main:my-list[main:parameter-1=current()/main:parameter-1]">Violated uniqueness for "main:unique-test/main:a/main:parameter-1"</sch:report>
If I change the rule to the second one the uniqueness of parameter-1 is checked.
pyang version: pyang 1.7 (on commit 0528aa8 - Martin Björklund, 4 days ago : Fixes #259 - multiple bases in identity)