Skip to content
Discussion options

You must be logged in to vote

If I understand how BeanSerializerModifier works it is called once per type.

Yes.

Right, @JsonSerialize won't work probably: not all callbacks are necessarily called, and specifically no default serializer likely passed even if they were. So BeanSerializerModifier works for globally registered serializers.

You can introspect annotations on createContextual() method if implementing "ContextualSerializer".
That gets called once per serializer, before first use.
You can then access default per-type Serializer since one being used is not globally register (no infinite looping :) ).

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@cowtowncoder
Comment options

Answer selected by Blackbaud-JasonBodnar
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants