-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
[Avro] JsonMappingException
for union types with multiple Record types
#168
Comments
Thank you for reporting this -- I hope to evaluate and merge patch (#170) for inclusion in 2.10. |
Rebased #176 for 2.10 |
JsonMappingException
for union types with multiple Record types
@amorimjuliana @marcospassos Thank you for reporting the problem, contributing fix -- this should be resolved in 2.10.0.pr2 (released I hope by end of August)! |
I did have to do minor tweaking to eliminate now unused method variants that do not take |
Thank you, @cowtowncoder! |
@cowtowncoder Sorry for using this thread, but this is the closest issue I found to what I am having. I'm trying to serialize a I'm using the same schema in Python and it works seamlessly. Am I doing something wrong? Example of the map:
Jackson code block:
Schema:
I didn't post the whole schema because it is very long, but it is essentially an array with more records of different structures |
As things are, this usage is not supported by Jackson Avro module: handling of Union types is difficult and what we would need here is to make Avro backend use Polymorphic Type handling of So for time being unfortunately this would be "unsupported capability of Avro". |
I believe this is a different issue from #123 and #164.
In the following example, we have a union schema with 5 record schemas and an abstract class annotated with
@Union
as follows:Problem 1: serialize as a concrete class and deserialize as an abstract class
When we serialize a value using the concrete class
ClassA
and then try to deserialize it as theAbstractClass
, we get the following error:Although serializing and then deserializing the class using the concrete class
ClassA
works.Problem 2: serialize as an abstract class
Also, the serialization using the abstract class
AbstractClass
does not work:I believe that both cases are valid and should not cause errors, or maybe I'm missing something.
The text was updated successfully, but these errors were encountered: