https://kotlinlang.org logo
#http4k
Title
# http4k
x

Xavier Hanin

01/31/2019, 8:43 AM
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

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.
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
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