Error: Response validation failed: void does not allow a value
RudrikaFichadiya opened this issue · 0 comments
RudrikaFichadiya commented
Defined path and response:
"/users/validateLogin":{
"x-swagger-router-controller": "users",
"post": {
"tags": ["Users"],
"operationId": "validateLogin",
"parameters": [
{
"name":"data",
"in":"body",
"required":false,
"schema":
{
"$ref":"#/definitions/Login"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "object",
"properties": {
"responseCode": {
"type": "number",
"example": "0,"
},
"message": {
"type": "string",
"example": "Success"
},
"errCode": {
"type": "number",
"example": 2002
},
"info": {
"type": "string"
}
}
}
}
}
}
}
My function returns response as:
res.json({ responseCode: 0, message: 'Login successful', errCode : 4003, info: tokenData.token});
Where the info has string typed data.
Facing problem with this error :
Error: Response validation failed: void does not allow a value