So we’d need the body lens to use a mapper configured specifically for the route, not for the whole application
Xavier Hanin
01/31/2019, 9:13 AM
I think I need to override the
asCompactJsonString
to set the view on the writer (at least to use the view during serialisation). I’m trying a solution, I think I’m not too far
d
dave
01/31/2019, 9:54 AM
Not sure that's going to work for a couple of reasons:
1. as you need access to the internal mapper, unless you have a custom mapper used just for views.
dave
01/31/2019, 9:55 AM
2. See 1. 🙂
x
Xavier Hanin
01/31/2019, 10:38 AM
And I got a problem because of the 2 steps used during deserialisation / serialisation. Jackson doesn’t support to use a view in the
convertValue
, and then when writing the
JsonNode
to a
String
it’s too late to apply the view
Xavier Hanin
01/31/2019, 10:39 AM
But I have solution, I’ll share it here
Xavier Hanin
01/31/2019, 10:40 AM
It seems I can’t a snippet to a thread, I’ll post it on the channel