Forum Discussion
hugomario
Staff
6 years ago
The openapi3 code generated for nodejs is not longer using swagger-tool lib (the one that set swagger object into a req object), because the project does not support OAS3. So, the nodejs code is actually working with https://github.com/cdimascio/express-openapi-validator
and you can retrieve info from request object calling an openapi object, something like: req.openapi
Here is an example of the openapi object inside a request object:
openapi: {
expressRoute: '/pet/findByStatus',
openApiRoute: '/pet/findByStatus',
pathParams: {},
schema: {
tags: [Array],
summary: 'Finds Pets by status',
description: 'Multiple status values can be provided with comma separated strings',
operationId: 'findPetsByStatus',
parameters: [Array],
responses: [Object],
security: [Array],
'x-swagger-router-controller': 'Pet'
}
}
sonya_m
Alumni
6 years agoHi MenschenToaster! Does this answer your question? Please let us know🙂