ā11-17-2023 07:38 AM
Hi,
I need to generate xsd from yang 1.1.
The yang 1.1 compiled OK in NSO 6.1.
But I got the error with pyang.
I use the command:
pyang -f xsd -o ./ppp dnnapi.yang
pyang throws error:
/opt/ncs/current/src/ncs/yang/tailf-ncs-plan.yang:2: error: bad value "1.1" (should be version)
dnnapi.yang:3: error: bad value "1.1" (should be version)
It also throws error for "anydata":
error: unexpected keyword "anydata"
Did I do anything wrong?
THX
sm000x
ā11-17-2023 08:33 AM
What version of pyang are you using? If i recall, "anydata" keyword was introduced in YANG 1.1, so you need a version of pyang that understands YANG 1.1.
ā11-17-2023 08:58 AM
ā11-17-2023 09:12 AM
Hey @sm000x NSO-6.1's pyang version 1.5. so this version of pyang should be able to generate XSD from yang 1.1 files one would think, but based on your error there may be inconsistencies between the yang 1.1 schema and pyang's expectations. Its a long shot, but use a different YANG to XSD converter like yang2xsd or oxyyang.
Hopefully someone else will know or have seen this.
Hope this helps.
ā11-17-2023 09:26 AM
ā11-17-2023 03:24 PM
Hi
How does your YANG module look like? I think you may missing the version in the module:
module name-of-module { yang-version 1.1;
<SNIP>
}
HTH
Marcel
ā11-18-2023 06:46 AM
ā11-19-2023 11:04 PM
As @bigevilbeard mentioned, this might be a pyang version issue - consider updating pyang:
pip install pyang --upgrade
ā11-21-2023 11:55 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide