libyang icon indicating copy to clipboard operation
libyang copied to clipboard

Validating

Open wlupton opened this issue 5 years ago • 1 comments

I'm interested in validating YANG package instances, starting with the examples in draft-rwilton-netmod-yang-packages Appendix A. But I don't even know whether I should expect yanglint to be able to do this. (Does #1128 suggest not?)

Here's my command (I've played with various --type values).

% /usr/local/bin/yanglint --version
yanglint SO 1.9.5
% make
/usr/local/bin/yanglint \
--path=../../../yang-external/ --verbose --allimplemented  --strict --type=data --merge --format=xml --default=all-tagged \
--output=example-ietf-network-device-pkg.json.out \
../../../yang-external//ietf-datastores.yang \
../yang/[email protected] \
../yang/[email protected] \
example-ietf-network-device-pkg.json
err : Unknown element "instance-data-set".

The JSON is as in the ID but with the first two lines removed. These are the first few lines:

 {
  "ietf-yang-instance-data:instance-data-set": {
    "name": "example-ietf-network-device-pkg",
    "pkg-schema": {
       package: "[email protected]"
    },

wlupton avatar Aug 21 '20 10:08 wlupton

Hi, unfortunately, you are right and this extension (ietf-yang-structure-ext:structure) is not implemented. We have implemented only ietf-restconf:yang-data (which seems quite similar, not sure what the differences are). But we do want to support this extension in the new libyang version 2 we are currently working on, we will let you know in this issue.

michalvasko avatar Aug 21 '20 11:08 michalvasko

Missed this issue and it is likely not relevant anymore, but current libyang does support the structure extension for several months now.

michalvasko avatar Feb 10 '23 12:02 michalvasko