According to RFC6243, “default” uses the wrong namespace
rfc6243:
I understand that default is defined in the urn:ietf:params:xml:ns:netconf:default:1.0 namespace, but currently libyang2 incorrectly uses the urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults namespace for default.
The related error implementation includes parsing, printing, and other code processes.
Please confirm whether the current implementation complies with the protocol. If it does not comply with the protocol, please let me know your plan to fix this issue.
Thanks!
This XML can be parsed without errors, just like the test case, but it may not be in compliance with the RFC.
<?xml version="1.0" encoding="UTF-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1744338271054">
<edit-config>
<target>
<running />
</target>
<config xmlns:ncwd="urn:ietf:params:xml:ns:yang:ietf-netconf-with-defaults">
<container_test xmlns="urn:ietf:params:xml:ns:yang:netconf_sample">
<test_default>
<id>0</id>
<number ncwd:default="true">32</number>
</test_default>
</container_test>
</config>
</edit-config>
</rpc>
It seems you are right but I am not sure I want to fix this, since you are the first person to notice this and it has been working like this for years. Changing it would entail adding a new internal module with the correct namespace and the default metadata, which is quite a significant change.
This issue causes servers using libyang integration to not interact correctly with clients that implement the default namespace. While this is a heavy historical burden, let's try to fix this issue together. Also, if you have fixed this issue, please reply to this issue. Thanks a lot!
Fine, this should be fixed but it is committed only in an internal branch and this branch is not compatible with any of the other projects (sysrepo, libnetconf2, netopeer2) yet. It will still take a few months until it is and is merged into devel. Then still a few weeks at least before we officially release it because there will be several major changes.
May I ask if these code test have passed? Are there any considerations for not merging them into the master branch? Thank you for your response.@michalvasko @Roytak
Yes, the changes are fine but their release is a bit delayed. But it should not take now more than a week.
Did you miss the changes here in your commit? Please confirm.
Additionally, have these codes been merged into the master branch? Some of our development rules require that only community-accepted code be used. Please merge them as soon as possible. Thank you very much!
Yes, even this use-case is covered in a later commit and you can find them all in the devel branch for now. There are quite a lot of changes so we want to test them for some time until they are merged to master so you will have to wait a few months.