Closed jansupol closed 6 years ago
@m0mus Commented @readlearncode It looks like a bug in Yasson. Can I ask you to move it into Yasson issues tracker here: https://github.com/eclipse/yasson/issues
@readlearncode Commented Moved to https://github.com/eclipse/yasson/issues/49
Attempting to deserialize nested class with constructor defined throws JsonbException: No default constructor found.
Given Json String:
{"name":"Inner Class"}
and
Class structure:
My reading of the specification section 3.7.2 (Nested Classes) and 3.7.1 (Scope and Field access strategy) is that the above deserialization scenario should work.
Note that adding default constructors does not fix it.
POM: https://github.com/readlearncode/Java-EE-8-Sampler/blob/master/json-b-1-0/pom.xml CODE: https://github.com/readlearncode/Java-EE-8-Sampler/blob/master/json-b-1-0/src/main/java/com/readlearncode/devWorks/overview/NestedClassExample.java TEST: https://github.com/readlearncode/Java-EE-8-Sampler/blob/master/json-b-1-0/src/test/java/com/readlearncode/devWorks/overview/NestedClassExampleTest.java