-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Support enum avro serialization with default value #391
base: 2.18
Are you sure you want to change the base?
Conversation
* | ||
* @since 2.16 | ||
*/ | ||
private static final JacksonAnnotationIntrospector JACKSON_ANNOTATION_INTROSPECTOR = new JacksonAnnotationIntrospector(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, AnnotationIntrospector
should be passed from outside; it may be reconfigured by caller.
We should not rely on default instance.
This just means some more plumbing of things to get AnnotationIntrospector
passed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. thanks
Ok, I realized that the avro core dependency upgrade to 1.9.x would be needed to access "enum default" information (both create and get). But this upgrade is not possible since So I am not 100% sure this is actually achievable at this point. I did make couple of changes to PR, but it is unfortunately not in a compilable state. |
Ok, changed target to 2.18, merged changes and updated call of deprecated method to non-deprecated. @Sonic-Rage This might be ready for merge, but I think you should have a look. One thing before merging tho: I think I'd need a CLA (https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf) if you didn't send one earlier. |
@@ -169,4 +172,38 @@ public void testSchemaForUntypedMap() throws Exception | |||
verifyException(e, "Maps with non-stringable keys are not supported (yet?)"); | |||
} | |||
} | |||
|
|||
// Issue 388 Default value for enums with class | |||
public void testClassEnumWithDefault() throws Exception |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test better belongs to EnumTest
class.
EnumTest
did not exists at the time of this PR yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will move.
Fixes #388.