I want to return below json with BadRequest
{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "frId is/are not required and should not be sent",
"source": null,
"step": null,
"reason": null,
"metadata": {}
}
}
You can make a class to encapsulate the response object like this:
Then you can return a instance of that object like this: