Skip to content

Custom serializer in pretty printer for binary fields #3940

Answered by martinpaljak
martinpaljak asked this question in Q&A
Discussion options

You must be logged in to vote

My assumption was incorrect. I had a bunch of serializers for special objects "BlahAsBytesSerializer" in a module (for CBORMapper), so by just adding "BinaryAsHex" serializer to the end of same module and using the module with ObjectMapper (used for printing) did not "stack". A member of type Blah was first converted to byte[] and then printed as base64 whereas a simple byte[] was indeed serialized as hex.

"fixed" this by making "BlahAsHex" serializer. Would be cool if the mapper respected such two stage conversions, first from custom object to byte[] and then because same module has a serializer for byte[], would use that?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@cowtowncoder
Comment options

@martinpaljak
Comment options

@cowtowncoder
Comment options

Answer selected by martinpaljak
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