Hi Lada,

Sorry for the delay, I just found out this due to the other chain.

I can only say: it is amazing that yangson can do this already, and fits the 
proposed mechanics of the draft quite well. I’ll take some time to check it out.

In the draft we opted for having the tree of leafs with no coverage, would it 
be the same as filtering on {0} on this output, I would guess.

Camilo

> On 16 Sep 2025, at 12:05, Ladislav Lhotka 
> <[email protected]> wrote:
> 
> Hi Benoit,
> 
> FWIW, yangson [1] allows for printing ascii tree with indicated coverage of 
> each schema node by preceding validations, like this:
> >>> print(dm.ascii_tree(no_types=True, val_count=True), end='')
> +--rw example-2:bag {1}
>    +--ro bar {1}
>    +--rw baz? {0}
>    +--rw foo# [number] {5}
>       +--rw in-words? {5}
>       +--rw number {5}
>       +--rw prime? {3}
> 
> See [2] for details.
> 
> Cheers, Lada
> 
> PS. I have to acknowledge this was originally Kent’s idea.
> 
> [1] https://github.com/CZ-NIC/yangson
> [2] 
> https://yangson.labs.nic.cz/datamodel.html#yangson.datamodel.DataModel.ascii_tree
>  
> <https://yangson.labs.nic.cz/datamodel.html#yangson.datamodel.DataModel.ascii_tree>—
> Ladislav Lhotka
> PGP Key ID: 0xB8F92B08A9F76C67
> 
>> 16. 9. 2025 v 10:48, [email protected]:
>> 
>>  FYI.
>> 
>> Regards, Camilo and Benoit
>> 
>> 
>> -------- Forwarded Message --------
>> Subject:     [onions] FW: New Version Notification for 
>> draft-cardona-claise-onion-yang-coverage-00.txt
>> Date:        Mon, 15 Sep 2025 12:21:09 -0500
>> From:        Camilo Cardona <[email protected]> <mailto:[email protected]>
>> To:  [email protected] <mailto:[email protected]>
>> 
>> Hello all,
>> 
>> While working on a large YANG module, we developed a prototype for a tool to 
>> measure how much of a module is “covered” by instance examples. In the 
>> process of thinking about how to share the tool more broadly, we started 
>> asking ourselves what would be needed to automate the process end-to-end.
>> 
>> This led us to write a draft, link below this email. 
>> The document proposes:
>> 
>> - A way to consistently extract example instances from IETF documents.
>> 
>> - Validate those examples against the YANG modules they use.
>> 
>> - Calculate a coverage view of the module based on those examples.
>> 
>> The main goal of this is to end up with at least one tool that will be 
>> available to implement this process. Such a tool could help authors and 
>> reviewers improve the design of YANG models by making gaps in examples and 
>> coverage visible.
>> 
>> Although ONION is still taking shape, its focus YANG tooling made us think 
>> this would be the right place to start presenting the work and gathering 
>> feedback.
>> 
>> Comments, suggestions, and reactions are welcome.
>> 
>> Thanks,
>> Camilo
>> 
>> On 15/9/25, 12:17, "[email protected] 
>> <mailto:[email protected]> <mailto:[email protected]> 
>> <mailto:[email protected]>" <[email protected] 
>> <mailto:[email protected]> <mailto:[email protected]> 
>> <mailto:[email protected]>> wrote:
>> 
>> 
>> A new version of Internet-Draft
>> draft-cardona-claise-onion-yang-coverage-00.txt has been successfully
>> submitted by Camilo Cardona and posted to the
>> IETF repository.
>> 
>> 
>> Name: draft-cardona-claise-onion-yang-coverage
>> Revision: 00
>> Title: Guidelines for YANG Example Validation and Coverage Analysis in IETF 
>> Documents
>> Date: 2025-09-15
>> Group: Individual Submission
>> Pages: 12
>> URL: 
>> https://www.ietf.org/archive/id/draft-cardona-claise-onion-yang-coverage-00.txt
>>  
>> <https://www.ietf.org/archive/id/draft-cardona-claise-onion-yang-coverage-00.txt>
>>  
>> <https://www.ietf.org/archive/id/draft-cardona-claise-onion-yang-coverage-00.txt>
>> Status: 
>> https://datatracker.ietf.org/doc/draft-cardona-claise-onion-yang-coverage/ 
>> <https://datatracker.ietf.org/doc/draft-cardona-claise-onion-yang-coverage/> 
>> <https://datatracker.ietf.org/doc/draft-cardona-claise-onion-yang-coverage/>
>> HTMLized: 
>> https://datatracker.ietf.org/doc/html/draft-cardona-claise-onion-yang-coverage
>>  
>> <https://datatracker.ietf.org/doc/html/draft-cardona-claise-onion-yang-coverage>
>>  
>> <https://datatracker.ietf.org/doc/html/draft-cardona-claise-onion-yang-coverage>
>> 
>> 
>> 
>> 
>> Abstract:
>> 
>> 
>> This document defines guidelines for including YANG example instances
>> in IETF documents in a way that enables automatic extraction and
>> validation. It introduces the concept of YANG module "coverage" to
>> measure how thoroughly example instances exercise a YANG module's
>> data nodes. The goal is to improve the quality and usability of YANG
>> models in IETF documents by providing authors with tools to validate
>> their examples and assess coverage completeness.
>> 
>> 
>> 
>> 
>> 
>> 
>> The IETF Secretariat
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> onions mailing list -- [email protected] <mailto:[email protected]>
>> To unsubscribe send an email to [email protected] 
>> <mailto:[email protected]>
>> _______________________________________________
>> netmod mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
> _______________________________________________
> netmod mailing list -- [email protected]
> To unsubscribe send an email to [email protected]

_______________________________________________
netmod mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to