-
Notifications
You must be signed in to change notification settings - Fork 14
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
JSON namespace-qualified names not supported #33
Comments
It should be supported for parsing JSON bodies as well. This is new so
there might be a bug. Can you construct a failed unit test or provide some
more info?
…On Wed, Dec 21, 2022 at 4:50 PM tdecorte123 ***@***.***> wrote:
Hi, I'm experimenting with these nice libraries by writing a prototype
restconf server for some custom yang models.
It works fine except when my querie contains namespace prefixes. Looking
at the yang library, it seems that namespaces are not supported... Except
for a compatibility mode used in the JSON writer but not when parsing JSON
body queries.
Is this correct or am I missing something somewhere?
Thx
—
Reply to this email directly, view it on GitHub
<#33>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7SI3QVLZSZRLOFT6CTWON3R3ANCNFSM6AAAAAATGCCE6E>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Hi, thx for the reply. In a nutshell, I have an identityref leaf using a derived type defined in an imported yang module. When processing the leaf, this code: compares namespace-qualified name receive in the JSON with the derived type name without the namespace. In other words it compares A:B with B. Which fails. If I remove the namespace from the JSON body, it works fine. I can provide a small example if needed. Thx |
Hi, A quick and dirty example that will panic at startup: main.go.txt If you remove the namespace ("type":"derived-type") it works... But when getting back the "type" leaf you get this result: Here the namespace is applied to the key and not the value which is incorrect as far as I know. type doesn't require a namspace since it's already in Module-test namespace and the derived type needs to be prefixed. As a reference, section 6.8 of RFC7951. Thx |
I was able to duplicate this and spec reference confirms your assertion. I should have fix and unit test in next couple days, thanks for reporting! |
Hi, I'm experimenting with these nice libraries by writing a prototype restconf server for some custom yang models.
It works fine except when my querie contains namespace prefixes. Looking at the yang library, it seems that namespaces are not supported... Except for a compatibility mode used in the JSON writer but not when parsing JSON body queries.
Is this correct or am I missing something somewhere?
Thx
The text was updated successfully, but these errors were encountered: