express-openapi-validator
Advanced tools
Comparing version 0.53.3 to 1.0.0
{ | ||
"name": "express-openapi-validator", | ||
"version": "0.53.3", | ||
"description": "", | ||
"version": "1.0.0", | ||
"description": "Automatically validate API requests using an OpenAPI 3 and Express.", | ||
"main": "dist/index.js", | ||
@@ -41,6 +41,6 @@ "scripts": { | ||
"@types/cookie-parser": "^1.4.1", | ||
"@types/express": "^4.16.1", | ||
"@types/mocha": "^5.2.6", | ||
"@types/express": "^4.17.0", | ||
"@types/mocha": "^5.2.7", | ||
"@types/morgan": "^1.7.35", | ||
"@types/node": "^11.13.11", | ||
"@types/node": "^11.13.13", | ||
"@types/supertest": "^2.0.7", | ||
@@ -51,15 +51,15 @@ "body-parser": "^1.19.0", | ||
"cookie-parser": "^1.4.4", | ||
"coveralls": "^3.0.3", | ||
"express": "^4.17.0", | ||
"coveralls": "^3.0.4", | ||
"express": "^4.17.1", | ||
"mocha": "^6.1.4", | ||
"morgan": "^1.9.1", | ||
"nodemon": "^1.19.0", | ||
"nodemon": "^1.19.1", | ||
"nyc": "^13.3.0", | ||
"prettier": "^1.17.1", | ||
"prettier": "^1.18.2", | ||
"source-map-support": "0.5.11", | ||
"supertest": "^4.0.2", | ||
"ts-node": "^8.1.0", | ||
"ts-node": "^8.2.0", | ||
"tsc": "^1.20150623.0", | ||
"typescript": "^3.4.5" | ||
"typescript": "^3.5.1" | ||
} | ||
} |
@@ -85,2 +85,20 @@ # express-openapi-validator | ||
// 4. Add a route upload file(s) | ||
app.post('/v1/pets/:id/photos', function(req, res, next) { | ||
// DO something with the file | ||
// files are found in req.files | ||
// non-file multipar params can be found as such: req.body['my-param'] | ||
console.log(req.files); | ||
res.json({ | ||
files_metadata: req.files.map(f => ({ | ||
originalname: f.originalname, | ||
encoding: f.encoding, | ||
mimetype: f.mimetype, | ||
// Buffer of file conents | ||
// buffer: f.buffer, | ||
})), | ||
}); | ||
}); | ||
// 5. Create an Express error handler | ||
@@ -87,0 +105,0 @@ app.use((err, req, res, next) => { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
43264
1
222