In sitebricks, I can easily deserialize a class from params in json format in Sitebricks @Service
method like this:
request.read(Person.class).as(Json.class);
But how do I deserialize a class from get/post params?
I know the Request
object has access to the params (request.params()
) but it would require more effort.
If the object that I want deserialize is not the service itself, then I would have to inject Json to do the deserialization.