1.0.6 • Published 6 years ago

swagger-param-sanitizer v1.0.6

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

swaggerParamSanitizer

Params are passed in as strings in express, and this middleware converts them into the ints, booleans, etc. that they should be, as defined in the swagger doc.

Example usage:

const swagger = require('./my-swagger.json')
const sanitizer=require('swagger-param-sanitizer')(swagger)
const express = require('express')
const app = express()
app.post('/api/doSomething',sanitizer,(req,res)=>{
console.log('these should have the proper types now:')
console.log(req.params)
console.log(req.query)
console.log(req.body)
})
1.0.6

6 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago