0

I'm setting my Node.js project with swaggerize-express, and are currently testing my backen using supertest to test my backend.

When I run the supertests, and it fails due to swagger rejecting (i.s. input validation fails) the data I pass to it, currently I simply get a 400 error message, without any details on what's wrong with my query.

I'd like the backend to provide some hints as to what input data it rejects. I haven't found any debug options to set in swaggerize-express, so how can I go about getting the backend to ouput some details on the validation errors? Wether the validation errors are provided in the server log or in the data returned to the client is not important at this point, although I'd prefer the latter.

kenneho
  • 401
  • 1
  • 7
  • 24

1 Answers1

0

if you deploy your API in a Microsoft Azure App Service you will take benefit of the Output Logs. Check my post on how to deploy a node.js API quickly in Azure:

http://mosshowto.blogspot.fr/2017/10/try-azure-app-service.html

When it's deployed, go to the Visual Studio Code online editor, check your deployment.Then, Hit the run button. The server will try to start your API and will log any error in the output if needed:

Azure Visual Studio Code online Output logs

Marc Charmois
  • 99
  • 1
  • 3