So we’d need the body lens to use a mapper configu...
# http4k
x
So we’d need the body lens to use a mapper configured specifically for the route, not for the whole application
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
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.
2. See 1. 🙂
x
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
But I have solution, I’ll share it here
It seems I can’t a snippet to a thread, I’ll post it on the channel