freeconf / yang

Standards-based management for Golang microservices
Apache License 2.0
38 stars 15 forks source link

Panic when 'config:true' is added inside a choicecase in yang #83

Closed davidmat50 closed 1 year ago

davidmat50 commented 1 year ago

This is in continuation to https://github.com/freeconf/yang/issues/74

only one yang file mentioned in https://github.com/freeconf/yang/issues/74 loads succesfully. the other one panics.

file: basic_config2.yang

module basic_config2 {

    namespace "urn:params:basic_config";
    prefix basic_config;

    yang-version 1.1;

    container root-container {
        leaf leaf-init {
            description "This is a leaf with config false";
            type boolean;
            default true;
            units USD;
        }

        choice choice-init {
            description "This is a choice with config false";
            default case-A;
            case case-A {
                leaf leaf-init1 {
                    type string;
                    config true;
                }
            }
            case case-B {
                leaf leaf-init2 {
                    type string;
                }
            }
        }
    }
}
dhubler commented 1 year ago

little behind, but i'll take a look in next few days

dhubler commented 1 year ago

fixed