Open jansupol opened 6 years ago
@bravehorsie Commented There is already a pull request for this in the Yasson RI. https://github.com/eclipse/yasson/pull/64 @m0mus Can we move annotation and JsonbConfig in the above pull request to the spec for next release? Looks like a handy feauture.
@marceloverdijk Commented Can that solution be used without an @Annotation? In my case I cannot change the classes itself.
@bravehorsie Commented You can also add mapping with JsonbConfig see https://github.com/eclipse/yasson/pull/64/files#diff-42990ea8091951c02b2166a51a23f6a6 second test method. In your case it is also enough to call: Customer customer = jsonb.fromJson(json, CustomerImpl.class);
@marceloverdijk Commented Thanks! Looking forward to see this incorporated in the jsonb spec.
I have a interface model like:
For each interface there is a single implementation. Important to note that the model contains nested properties/types using (again) interfaces.
How can this be parsed?
Above gives exception:
javax.json.bind.JsonbException: interface com.acme.Customer not instantiable
Note: I cannot change the interfaces nor the concrete implementations as these are provided.