[ 
https://issues.apache.org/jira/browse/AVRO-3649?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17623039#comment-17623039
 ] 

Christophe Le Saec commented on AVRO-3649:
------------------------------------------

Change code to not expose Jackson API to public interface.

For Nullable & withDefault annotations, it's now compatible, like show on [this 
unit 
test|https://github.com/apache/avro/blob/62e986d5c7c82126bce0bf401d433a54d2db9dfa/lang/java/avro/src/test/java/org/apache/avro/reflect/TestReflect.java#L540-L552].

_withDefault parameter to @Nullable_
would make possible to have :
{code:java}
    @Nullable(withDefault="Hello")
    @AvroDefault("World")
{code}
As nullable & default value are not link ({_}except the convention that 
nullable field without explicit default has null for default, like in Java for 
uninitialized field{_}); i think i would be preferable to keep it separate.

> [JAVA] reorder union types to match default value
> -------------------------------------------------
>
>                 Key: AVRO-3649
>                 URL: https://issues.apache.org/jira/browse/AVRO-3649
>             Project: Apache Avro
>          Issue Type: Improvement
>            Reporter: Daniel Heinrich
>            Priority: Trivial
>              Labels: pull-request-available
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> The Avro specification requires that a default value matches the first schema 
> of a union type.
>  
> Using @Nullable on a field will return a union type of the form ["null", 
> "<something>"].
> @Nullable also sets the default value to "null".
>  
> It is not possible to override this default value w{color:#172b4d}ith 
> @AvroDefault because of the order of the schemas in the generated 
> union.{color}
>  
> It would be nice that union types are automatically reordered to match the 
> type of the provided default value.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to