Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

Error: Response validation failed: void does not allow a value #612

Open
RudrikaFichadiya opened this issue Nov 30, 2019 · 0 comments
Open

Comments

@RudrikaFichadiya
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant