You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not possible to do that with configuration options, there is a PR proposing adding annotations with via configuration options (which has drawbacks/limitations).
There are however several possibilities how that could theoretically be achieved:
by using/piggyback'ing customAnnotator such that would override public void typeInfo(JDefinedClass clazz, JsonNode schema) or usage of CompositeAnnotator (if generating pojo's programmatically).
NB! This solution won't annotate enum's
publicclassCustomAnnotatorextendsJackson2Annotator {
publicCustomAnnotator(GenerationConfiggenerationConfig) {
super(generationConfig);
}
@OverridepublicvoidtypeInfo(JDefinedClassclazz, JsonNodeschema) {
// add custom annotationsclazz.annotate(Deprecated.class);
// delegate the rest to super classsuper.propertyInclusion(clazz, schema);
}
}
by using/providing customRuleFactory which would return customized (extended) ObjectRule and EnumRule capable of adding desired annotations.
No description provided.
The text was updated successfully, but these errors were encountered: