FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

Make JsonSubTypes.Type a repeatable annotation #149

Closed woshilapin closed 5 years ago

woshilapin commented 5 years ago

In Java8, having a wrapper annotation is not needed anymore if you make the wrapped annotation @Repeatable (see this page). I'm just worry there was a reason behind this change not being done so please comment if there is.

cowtowncoder commented 5 years ago

That is good to know with Jackson 3.0, which requires Java 8 baseline. But for Jackson 2.x we only require Java 6 (for annotations, streaming), or Java 7 (databind, most other modules).

cowtowncoder commented 5 years ago

Also forgot to say: thank you for bringing this up! I was actually not aware of this possibility, and I think it can be used with 3.x. I'll just need to read up on it first.

woshilapin commented 5 years ago

Yes, I was worry there was an actual reason for not having this like supporting Java 6. Note also that I didn't dig more than that and proposed the update only for JsonSubTypes but there might be some other annotation that would benefit of that change too. Thanks for you fast response.

cowtowncoder commented 5 years ago

@woshilapin Yes, I'll keep this in mind; there are probably one or two other places (for some properties of @JsonFormat I think).