-
Notifications
You must be signed in to change notification settings - Fork 10
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
support for YANG annotations (attributes) #147
Comments
I am working on an implementation soon. |
I wrote https://cabo.github.io/yang-metadata/draft-bormann-cbor-yang-metadata.html Please have a look, in particular into the two "questions" inside. I wouldn't mind submitting a -00 for Wednesday's CBOR WG meeting. |
Would it be possible to write a YANG module for these now? |
I am trying to understand the draft. Most attributes do not have an 'annotation' defining them. How do attributes get encoded if no SIDs and only names? JSON uses "@" for all attributes for a container or list. |
The actual metadata annotations go into the metadata map. The proposed structure does away with the @ juggling by attaching he metadata to the actual YANG data nodes. |
The JSON version is hard to implement correctly so we don't. The XML approach is the only way CBOR should work.
Adding step (2) is not backward compatible with the YANG/CBOR RFC |
Hi Andy
On 16. Apr 2024, at 19:38, Andy Bierman ***@***.***> wrote:
The XML approach is the only way CBOR should work.
All attributes are present in the start-tag.
The same procedure can be used for all nodes:
1) identify and start node
2) parse all attributes for node
3) parse node content
4) end node
This is precisely what my draft-to-be does.
Nodes with attributes are encapsulated by CBOR Tag 109, which first has a metadata map with the attributes, and then the regular representation of the data node.
Adding step (2) is not backward compatible with the YANG/CBOR RFC
Not sure I understand this one.
Grüße, Carsten
|
I added a name-based example to the existing SID-based ones. https://datatracker.ietf.org/doc/draft-bormann-cbor-yang-metadata/ |
I will try to catch up on the new CDDL you are using in the draft. I assume a receiver that just knows the YANG/CBOR RFC will not expect this tag and metadata map. |
On 18. Apr 2024, at 19:30, Andy Bierman ***@***.***> wrote:
I will try to catch up on the new CDDL you are using in the draft.
The special tag approach makes sense. It is better than the "@" hack.
Right.
I assume a receiver that just knows the YANG/CBOR RFC will not expect this tag and metadata map.
Is that correct?
That is correct.
To introduce this feature, you’d need YANG-CBOR receivers to replace Tag 109 by its second array element.
(This is less work than the standin functionality for timestamps and IP addresses, which I would implement at the same time.)
Grüße, Carsten
|
RFC 7952 defines the 'annotation' extension.
This should be supported with a new namespace in the SID file.
This will allow attributes to be sent with the YANG data.
There are some attributes in use pre-7952 that do not have YANG modules.
A mechanism is needed to support SID file numbering even though
no YANG module exists (special range of manual assignments?)
Hoping for a CBOR tag and an algorithm to specify the order of data node/attribute node.
We have attributes that need to be known before the child nodes are parsed.
It is very convenient that XML has a start tag for this purpose.
The JSON encoding of attributes is not supportable because everything is unordered
The text was updated successfully, but these errors were encountered: