-
Bug
-
Resolution: Done
-
None
-
None
-
Operating System: All
Platform: All
-
8449
-
Normal
Here is model example:
typedef name1-ref {
type leafref
}
typedef name2-ref {
type leafref
}
container top {
leaf name1
leaf name2 { type string; }
}
container cont {
leaf ref {
type union
mandatory true;
}
}
Deserializing:
"cont":
{ "ref": "some-name" }Gives following exception:
2017-05-15 13:45:14.761 CEST [qtp114012533-50] WARN o.e.jetty.servlet.ServletHandler - /restconf/config/test:cont/
java.lang.IllegalStateException: Unable to load codec for class org.opendaylight.yang.gen.v1.urn.test.rev170101.Cont$Ref
at org.opendaylight.yangtools.binding.data.codec.impl.BindingCodecContext.getCodecForBindingClass(BindingCodecContext.java:306) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
[...]
Caused by: java.lang.NoSuchMethodException: org.opendaylight.yang.gen.v1.urn.test.rev170101.Cont$Ref.getName1Ref()
at java.lang.Class.getMethod(Class.java:1786) ~[na:1.8.0_45-internal]
at org.opendaylight.yangtools.binding.data.codec.impl.UnionTypeCodec.lambda$loader$0(UnionTypeCodec.java:33) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
at org.opendaylight.yangtools.binding.data.codec.impl.UnionTypeCodec$$Lambda$106/1574798546.call(Unknown Source) ~[na:na]
at org.opendaylight.yangtools.binding.data.codec.impl.BindingCodecContext.getCodecForBindingClass(BindingCodecContext.java:304) ~[mdsal-binding-dom-codec-0.9.3-Boron-SR3.jar:na]
Full trace included.