reference icon indicating copy to clipboard operation
reference copied to clipboard

Path Element: What if a key's value is an identityref or instance-identifier?

Open andaru opened this issue 6 years ago • 0 comments

The YANG types identityref and instance-identifier are represented differently in the IETF JSON (RFC7951) and XML (RFC6020) encodings.

Values of these types can also be the value in a constraint, e.g., using the RFC7951 JSON encoding, I believe you would have something like (as an XPath expression):

/bgp/global/afi-safis/afi-safi[afi-safi-name="openconfig-bgp-types:IPV4_UNICAST"]

Does the gNMI Path specification cover how these values should be encoded in a gRPC path (element)? I could not find that.

So, should identity values ever be used in qualified form in a gNMI path expression?

RFC7951 (https://tools.ietf.org/html/rfc7951#section-6.8) says:

   If the identity is defined in a module other than the leaf
   node containing the identityref value, the namespace-qualified form
   (Section 4) MUST be used.  Otherwise, both the simple and namespace-
   qualified forms are permitted.

andaru avatar Dec 21 '18 23:12 andaru