Hi NETMOD,
I am in the process of implementing draft-ietf-netmod-yang-json–08, and had
some queries as to the content. Hopefully there is some misunderstanding on my
part, or it helps to clean up the text for future people reviewing/implementing.
The phrase ‘namespace-qualified’ seems to have some ambiguity through the
document. For example, in the case that we have two modules:
module mod-a {
prefix "pfx-a";
namespace "http://a.tld";
container container-a {
leaf leaf-a {
type string;
}
leaf ref-a {
type identityref {
base SOME_IDENTITY;
}
}
}
}
module mod-b {
prefix "pfx-b";
namespace "http://b.tld";
container container-b {
leaf leaf-b {
type string;
}
leaf ref-b {
type identityref {
base SOME_IDENTITY;
}
}
}
}
Then, AIUI, the encoding needs to specify the names of the modules for both
container-a and container-b (since they sit at the root; and are in different
namespaces) - so we encode these as JSON objects named mod-a:container-a and
mod-b:container-b as per Section 4 of the document.
In this case, we never use the actual namespace (i.e., http://a.tld and
http://b.tld) so calling it ‘namespace qualified’ appears ambiguous. Should it
be simply referred to as ‘module-qualified’?
Secondarily, the example in Section 6.8 does not actually use the name of the
module, it rather uses the prefix (if for the interface-type leaf). This
doesn’t seem to be explained anywhere within the text. Is this a mistake?
If it’s not (and one could encode container-a and container-b above as
pfx-a:container-a and pfx-b:container-b), then how do we deal with this case:
module a {
import b { prefix "c"; }
leaf id {
type identityref {
base "c:SOME_IDENTITY";
}
}
}
module b {
...
prefix "b";
...
}
when we encode, if we’re just given a value, do we add the prefix that a uses
to import b, or the prefix that b defines itself? (If the prefix is used for
identityref values, then the same question exists for those values - today, one
must track all prefixes that are related to a certain identity value based on
different imports, such that one does not incorrectly reject some
prefix:identity statement that was valid).
It seems to me that using the module name consistently throughout the encoding
is preferable, since this cannot be different in a number of places; and isn’t
as long as the namespace value to make readability worse.
I also didn’t understand why an identityref value encodes the namespace in the
actual value? It seems like the “base” of the identityref should qualify all
possible values here; with the only case that we would ever need this is one
where we have:
leaf some-reference {
type union {
type identityref {
base "a";
}
type identityref {
base "b";
}
}
}
And a and b both define a value with the same name (where one needs the prefix
to be able to refer to the b version).
Thanks,
r._______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod