Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type identifier namespace #18

Closed
GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments
Closed

Type identifier namespace #18

GoogleCodeExporter opened this issue Mar 16, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Probably I have a problem with understanding of the specification
draft-ietf-netmod-yang-05.

The specification says:
* All derived type names defined within a parent node or at the top-     
level of the module or its submodules share the same type identifier
namespace.  This namespace is scoped to the parent node or module.

If I get it correctly, the following example should be considered as valid:
module type-uniqueness
{
    namespace "urn:test";
    prefix u1;

    container interface2 {
    typedef str1 {
        type string;
    }
    container interface2 {
        typedef str1 {
        type string;
        }
    }
    } 
}

Because both types are defined within different parent nodes and not at the
top-level of the module, i.e. the type identifiers belong to different
identifier namespaces. But pyang considers this as a collision.

If I the namespace for types is really defined in this way, then the
example should be invalid:

module type-uniqueness
{
    namespace "urn:test";
    prefix u1;

    container interface2 {
    typedef str1 {
        type string;
    }
    container interface2 {
        typedef str2 {
        type str1;
        }
    }
    } 
}

Because the second type definition is out of the 'str1' type scope. 

Original issue reported on code.google.com by kur...@gmail.com on 8 May 2009 at 9:36

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by mbj4...@gmail.com on 11 May 2009 at 7:58

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

I see that it was corrected in the specification and now it's clearly defined:
"All derived type names defined within a parent node or at the top-level of the
module or its submodules share the same type identifier namespace.  This 
namespace is
scoped to all descendant nodes of the parent node or module.  This means that 
any
descendent node may use that typedef, and it MUST NOT define a typedef with the 
same
name".

The issue can be closed.

Original comment by kur...@gmail.com on 28 Jul 2009 at 2:57

@GoogleCodeExporter
Copy link
Author

Original comment by mbj4...@gmail.com on 28 Jul 2009 at 10:26

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant