Repository navigation
Unwrapping object in custom serializer #4637
Unanswered
micsport13
asked this question in
Q&A
Replies: 2 comments 1 reply
|
Get the serializer for the constant value from the context, then call unwrappingSerializer() on it to get a serializer that will just spit out the fields. |
1 reply
|
Yeah you cannot simply omit START_/END_OBJECT write: contract is such that by default So I am not sure this is achievable without custom parent serializer too. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Due to some various factors and the complicated class structure I have, I need to use custom serialization rather than the default annotation based approach. I was wondering if there's any guides or specific methods I'm missing in order to unwrap a value within the object context. For context, here's my code:
The problem arises on the
jsonGenerator.writeObject(...line which works because I have wrapped the value by writing a field name but I was wondering, is it possible to unwrap that value and simply write the object within the value field name above?It currently results in:
but I would like
Is this possible in a custom serializer?
All reactions