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/47
Given the enum:
JSON is:
The binding value is the value returned by the overridden
toString()
method rather than thename()
method. This is in contrast to my reading of the specification, which says:The name method returns the identifier rather than the
toString()
value.Dependecies: org.eclipse/yasson: 1.0 javax.json.bind-api: 1.0 org.glassfish/javax.json: 1.1 javax.json/javax.json-api: 1.1
CODE: https://github.com/readlearncode/Java-EE-8-Sampler/blob/master/json-b-1-0/src/main/java/com/readlearncode/devWorks/overview/EnumExample.java TEST: https://github.com/readlearncode/Java-EE-8-Sampler/blob/master/json-b-1-0/src/test/java/com/readlearncode/devWorks/overview/EnumExampleTest.java