vstakhov / libucl

Universal configuration library parser
BSD 2-Clause "Simplified" License
1.63k stars 138 forks source link

YANG #115

Open lperkov opened 9 years ago

lperkov commented 9 years ago

Hi all,

I'm wondering if additional validation language work would be accepted in this project?

Specifically, I'd like to add support for validation by using YANG models. YANG is data modeling language defined in IETF:

http://tools.ietf.org/html/rfc6020

I have not yet looked deeply into the code but this should be doable. Before even thinking of engaging in such work I'm asking if this is something the project would benefit from?

Luka

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27786896-yang?utm_campaign=plugin&utm_content=tracker%2F483345&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F483345&utm_medium=issues&utm_source=github).
lperkov commented 9 years ago

@vstakhov can you maybe share your thoughts on the above?

vstakhov commented 9 years ago

I had no time to look deeply inside this validation language. At the first glance it looks complicated and uses xml for description. Are there any features that are supported by Yang and not supported, for example, by json schema? Anyway, if this implies to use some big external library, such as libxml2 or similar, then I'll be definitely against such a dependency.

lperkov commented 9 years ago

The benefit of having YANG as a validation language is in the fact that is driven by IETF.

It is important to make distinction between YANG and YIN. YANG is not XML while YIN is XML. One can convert YANG to YIN and vice versa. There is a library which I've used and am using in a different project for YANG validation. The project is libyang:

https://github.com/CESNET/libyang

It is possible that with json schema enables one can validate a configuration file same as it can be done via YANG model. However, with YANG we have an added benefit of having a lot of standardized models (and more are comming) for all sorts of items. With this in mind application developer can use predefined models and build aplication around it if he choses to do so. A list of currently available IETF YANG data models can be found here:

https://github.com/YangModels/yang/tree/master/standard/ietf/