-
Notifications
You must be signed in to change notification settings - Fork 121
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
Question: RestrictedClassType and Null value #33
Comments
I can't see any case where this can be valid. In general, pyangbind will try to cast the input to the type that is expected, so for example, if we have the following module: module "test" {
prefix "t";
namespace "http://rob.sh/yang/t";
container test {
leaf number {
type uint32;
}
leaf number-range {
type uint32 {
range "1..max";
}
}
}
} Then, we can do:
Since
You cannot set an {
"value": null
} is loaded by Python's
In your specific case, this isn't ever valid though - because if
So, I'd say that your input JSON is not valid. r. |
OK Rob, thanks for clarifying, that all seems fine to me. Much appreciated, |
I am working with a REST/JSON implementation, and serializing from JSON into Class Bindings
In the Yang model, there is a leaf with a range specified.
In the JSON being received, I am receiving a null value
maxCallDuration": null,
(Please ignore the different key name format in camel case, that's a quirk of the API)
In python, it generates a ValueError:
I'm curious if this is a problem with the YANG definition, or potentially the Yang Blinding object should accept Null?
Any thoughts?
Thanks,
Mark
The text was updated successfully, but these errors were encountered: