I'm using Google GSON in my Java application.
Imagine the following situation: A new JSON attribute was added in version 1.2.1
. How can I use this in the @Since
annotation? Obviously, @Since(1.2.1)
is not possible because 1.2.1
is not a valid double. My version format is <major>.<minor>.<patch>
.
Another thing I noticed if I have version 1.20
, GSON sees it as a lower version than e.g version 1.3
.
Any ideas how to solve this? Could maybe something like a custom excluder work? (does that even exist?)
Apart from the version issue, I noticed the @Since
annotation can be used for classes, too. I couldn't find any documentation about this. I would appreciate it if someone could give an explanation why this is useful.