Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to mark avro field deprecated in JSON/avsc?

Tags:

java

avro

I was looking for method to mark avro field deprecated in a way that generated Java code (getters, and setters for the field) are marked with @Deprecated annotation.

Puting @Deprecated into "doc" field doesn't work, because generator puts it into /** javadoc */.

like image 762
tworec Avatar asked Apr 26 '16 16:04

tworec


1 Answers

I have not had success getting the actual @Deprecated annotation into the generated java code, but the older style javadoc deprecation kind of works:

// schema avdl
record MyRecord {
    /** @deprecated unused */ union { null, int } count;
}

results in the generated java code having

/** @deprecated unused */
Integer count;

And some IDEs recognizes and highlights that (I use Intellij)

like image 63
Erik Avatar answered Sep 20 '22 13:09

Erik