how to mark avro field deprecated in JSON/avsc?
Asked Answered
N

1

19

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 */.

Nettles answered 26/4, 2016 at 16:52 Comment(0)
I
2

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)

Iata answered 20/2, 2021 at 0:48 Comment(1)
I have a .avsc file in JSON format. (How) can I apply this answer?Sherilyn

© 2022 - 2024 — McMap. All rights reserved.