Reputation: 449
I'm new to scala and I'm writing feature tests for a finatra and slick app, and I can't figure out why the response header is always sending back my resources as so:
{
success: true,
failure: false,
value: {
resources...
}
}
Has anyone encountered this before? How can I get the response body to just return the resources (the value
).
Upvotes: 1
Views: 109
Reputation: 1636
I guess you are returning a value as this:
val myFuture = serviceUsingSlick.getSomething
reponse.ok.json(myFuture)
Use instead (for instance):
val myFuture = serviceUsingSlick.getSomething
myFuture.map {
case Success(content) => reponse.ok.json(content)
case Failure(t) => response.internalServerError(t.getMessage)
}
Upvotes: 0