freeconf / yang

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

No support for mutiple bases for identityref type. #70

Closed davidmat50 closed 1 year ago

davidmat50 commented 1 year ago

As per RFC https://datatracker.ietf.org/doc/html/rfc7950#section-9.10.2, we can have mutiple bases for identityref type. But after laoding the yang file, only one of the bases is possible to be retriived from the strutucres.

The loading of the file with a leaf with identityref type which has mutiple bases is successfull, but only one the bases is being is stored after loading.

func (y *Type) Base() *Identity {
    return y.identity
}

File used:

module type_identityref_mutiple {

    namespace "urn:netcracker:params:type_identityref_mutiple";
    prefix type_identityref_mutiple;

    yang-version 1.1;

    identity init_i {
        description "Some initial identity";
    }
    identity identity-B {
        base "init_i";
    }
    identity identity-E {
        base "identity-B";
    }
    identity identity-F {
        base "identity-B";
    }
    identity identity-G {
        base "identity-E";
    }
    identity identity-H {
        base "identity-F";
    }
    identity identity-K {
        base "identity-F";
    }

    container root-container {

        leaf leaf-several-bases-1 {
            type identityref {
                base "identity-B";
                base "identity-E";
            }
        }
        leaf leaf-several-bases-2 {
            type identityref {
                base "identity-E";
                base "identity-B";
            }
        }
    }
}
dhubler commented 1 year ago

fixed