core-wg / yang-cbor

Internet-Draft for CBOR representation of YANG data
5 stars 10 forks source link

Word that includes schema nodes except choice, case #135

Closed cabo closed 2 years ago

cabo commented 2 years ago

We probably could use a word for schema nodes that we encode, i.e.,

(data node +) action, rpc, input, output, notification

Schema node also includes choice and case, which we aren't interested it.

cabo commented 2 years ago

How about:

representation: a representation of a data tree [RFC7950]. YANG currently has three representation formats: based on XML [RFC7950], JSON [RFC7951], and CBOR [RFCthis].

representation node: a schema node or an instance of a schema node that is part of a representation. This includes all data node instances, as well as most schema nodes, with the notable exceptions of "choice" and "case".

abierman commented 2 years ago

IMO it is a big mistake to omit choice and case schema nodes from numbering

1) very confusing to invent this artificial subset of schema node 2) it is very useful when parsing or encoding to start with the parent of the expected nodes 3) It is useful to do a GET on a choice or case, rather than the N possible GETs on the accessible descendants 4) it causes code to handle these 2 schema nodes in a special way (e.g. assign SIDs anyway)

abierman commented 2 years ago

YANG defines "data tree" which matches

    o  data tree: An instantiated tree of any data modeled with YANG,
     e.g., configuration data, state data, combined configuration and
    state data, RPC or action input, RPC or action output, or
     notification.
mcr commented 2 years ago

"If we include case and choice, then we can use the term schema node."

mcr commented 2 years ago

@abierman to create example?. No, just need to fix ietf-system example.

abierman commented 2 years ago

One use case for CoMI is the ability to generate client/server code that does not need to store name strings, only SIDs. In this type of implementation, all the schema item SIDs will be needed, even though choice and case will not be on the wire.

cabo commented 2 years ago

Closed by #136