Package level @JsonNaming ? #356
-
|
Hello 👋 In our team we're often using Unfortunately, we don't need it 100% of the time, especially whenever working with third party's APIs I recently wondered if something like what is done for the JSpecify And of course, by extension, for all Jackson annotation where it would be relevant 😅 What is your thoughts about it ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
@Mumeii Jackson has mix-in annotations that can sometimes be used like this. But aside from that there is no support nor plans to add package-level/targeted annotations. This is pretty fundamental constraints given that Jackson instead supports inheritance-based annotations (so sub-classes "inherit" base-class inheritances), and that would conflict with package-based ones (how would precedence work across inheritance/package-containment). So it is unlikely this would ever be added to core Jackson. Having said that, someone could perhaps write (possibly shareable) custom But more generally, if you want specific support in case of |
Beta Was this translation helpful? Give feedback.
@Mumeii Jackson has mix-in annotations that can sometimes be used like this.
But aside from that there is no support nor plans to add package-level/targeted annotations. This is pretty fundamental constraints given that Jackson instead supports inheritance-based annotations (so sub-classes "inherit" base-class inheritances), and that would conflict with package-based ones (how would precedence work across inheritance/package-containment).
So it is unlikely this would ever be added to core Jackson.
Having said that, someone could perhaps write (possibly shareable) custom
AnnotationIntrospectorthat would in fact apply package-level annotations.But more generally, if you want specific supp…