Open ghost opened 6 years ago
Are you using express of hapi? The data type validation is specified in the swagger API document.
Hi @tlivings , I am using express.
Where is the dataype of the query and path params accesed from? Which node module does it? Please let me know .
Regards, vaishnavi
I am not 100% sure what you are asking but let's see if this answers your question.
When a request comes in, after it has been parsed, the type validation runs. If a parameter isn't valid the client will receive a 400 status code.
In some cases there will be type coercion.
But after validation has run, there will not be a reference to the expected type. There will just be the value of the parameter.
Hi @tlivings , I have hosted APIs from a swagger specification. I am hitting an API from postman. I am receiving the query and path parameters in the URL in the handler.js (generator-swaggerize) using req.query for query parameters in the URL and req.params for path params of the URL of the API.
Where is the datatype of the query and path parameters decided in generator-swaggerize? How can I manipulate it before receiving in req.query or req.params in handler.js?