routing-controllers
routing-controllers copied to clipboard
question: Can we customize the response body using auto validating action parameters?
Hello, I want to remove "stuck" and "errors" from the response body created by auto validating action parameters. How to customize the response body created by auto validating action parameters? Here is the auto-generated response body.
{
"name": "BadRequestError",
"message": "Invalid queries, check 'errors' property for more info.",
"stack": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"errors": [
{"target": {"userId": 1111},"value": 1111,"property": "userId","children": [],"constraints": {"max": "userId must not be greater than 1000"}}
],
"paramName": ""
}
Thank you
@RirUchida the stack property should only be added if your node env is not prod. Could you please check if setting it helps?
I was able to remove the stack property with this setting. Tahnk you.
const app = createExpressServer({
development: false,
});
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.