I receive JSON by POST method in my router which I then return to the user. For some reason the returned JSON will have all numerical and boolean values casted to string. I am using koa-bodyparser if thats relevant.
Is there any way to avoid this?
Code:
var js = ctx.request.body.json;
ctx.body = {
status: 'success',
json: js
};
Input JSON:
{
"json": {
"numbers": 123
}
}
Output JSON:
{
"json": {
"numbers": "123"
}
}