0.0.0 • Published 6 years ago
swagger-mw v0.0.0
openapi-validator-mw
This is express middleware, based on swole that does openapi validation exactly as done in Pine.
I say openapi, rather than swagger, because after Swagger 2.0, the name changed to OpenAPI. We want to keep to the spec and the standard nomenclature.
The OpenAPI definitions should come from the @eaze/openapi module. The definitions in that module are not standard and the deviations are recorded on a clubhouse story. This module supports those inconsistencies.
Perhaps later we'll do a transform, converting the non-standard usage, to a standard through an call in the @eaze/openapi module.
Usage
const express = require('express')
const app = express()
const openapi = require('@eaze/openapi')
const options = {
lowercase: false,
strict: false,
hooks: false,
verbose: false
}
const openApiMw = require('@eaze/openapi-validator-mw')(openapi, options)
app.use(openApiMw)
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(3000, () => console.log('Example app listening on port 3000!'))
options
TBD
0.0.0
6 years ago