-
Notifications
You must be signed in to change notification settings - Fork 656
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
Openconfig-bgp-policy ::The community-member leaf-list needs to be reordered. #1202
Comments
Formally OC is yang v1.0 compliant, but this still looks like a change that should be implemented. Would you like to send a pull request to change the ordering? |
Also, to move the identity-ref to the first element in the list of union type, shouldn't the union order be:
|
I discussed this offline with others and it seems a change should not be needed. The order is currently
An implementation parsing json encoded string values like In other words, |
As per RFC 7950, Section 9.12, when defining a YANG node with a union data type that includes both string and identityref member types, it is crucial to order the identityref type before the string type. This ordering ensures that the parser correctly identifies and handles the identityref type before attempting to match the string type.
Example:
Consider the following YANG leaf-list definition:
In this example, the community-member leaf-list uses a union data type that includes three types:
1. oc-bgp-types:bgp-std-community-type
2. oc-bgp-types:bgp-community-regexp-type
3. oc-bgp-types:bgp-well-known-community-type
Detailed Type Definitions:
1. bgp-std-community-type:
2. bgp-community-regexp-type:
3. bgp-well-known-community-type:
Importance of Type Order:
In the union type, if identityref is not ordered before string, the parser may incorrectly match the input value as a string instead of recognizing it as an identityref. This can lead to errors in processing the data.
Proposed Solution:
To ensure correct parsing, it is recommended to:
Order the identityref type before the string type in the union. i.e) like below
The text was updated successfully, but these errors were encountered: