You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi guy I am using swagger for my project, The problem what i am facing "unable to get data from the response object" Can some one help me to identified what i have done wrong below ?
var SwaggerExpress = require('swagger-express-mw');
var app = require('express')();
//this is done for schema validation
var schemaValidator = require('./api/middlewares/schema_mw/schemaValidator');
var validator = new schemaValidator();
var SwaggerUi = require('swagger-tools/middleware/swagger-ui');
module.exports = app; // for testing
var config = {
appRoot: __dirname // required config
} ;
SwaggerExpress.create(config, function (err, swaggerExpress) {
if (err) {
throw err;
}
//install middleware to validate request object
app.use(validator.requestValidator.bind(validator));
app.use(SwaggerUi(swaggerExpress.runner.swagger));
// install middleware
swaggerExpress.register(app);
var middleware = function(req, res , next){
res.end = function(data , encoding) {
console.log(data);
}
app.use(middleware);
}
var port = process.env.PORT || 10010;
app.listen(port);
});
The text was updated successfully, but these errors were encountered:
I think you are in the wrong repository. This one is about the Open API specification (formerly Swagger specification), your problem seems about some kind of tooling based on that spec – from the code I would guess the correct project/repository to ask would be https://github.com/apigee-127/swagger-express. Please open an issue there (assuming its documentation doesn't help).
Hi guy I am using swagger for my project, The problem what i am facing "unable to get data from the response object" Can some one help me to identified what i have done wrong below ?
The text was updated successfully, but these errors were encountered: