5.2.1 • Published 7 years ago
confident v5.2.1
Confident treats your API specification (a .json file) as the source of truth for express routes, API documentation, and request/response validation. It's your swagger wagon.
Features
- Works with existing Express app.
- Everything is opt-in. Incrementally integrate or eject.
- Validate your API schema.
- Validate requests.
- Validate responses.
- Serves up API documentation.
- Serves up /api.json.
- Suggests schemas to increase coverage.
- Supports basePath.
Get started
npm install confident --save
api.json
{
"swagger": "2.0",
"info": {
"title": "Hello World",
"version": "1.0.0"
},
"paths": {
"/hello": {
"get": {
"summary": "Say hello to the world",
"operationId": "greet",
"responses": {
"200": {
"description": "Sweet success"
}
}
}
}
}
}
index.js
const confident = require('confident')
const express = require('express')
const app = express()
function greet (req, res) {
res.json('Hello, world.')
}
app.use(confident({
specification: './api.json',
docsEndpoint: '/docs',
operations: { greet }
}))
app.listen(3000)
Generated documentation
http://localhost:3000/docs
Tutorial video
See also
5.2.1
7 years ago
5.2.0
7 years ago
5.1.3
7 years ago
5.1.1
7 years ago
5.1.0
7 years ago
5.0.0
7 years ago
4.0.0
7 years ago
3.2.2
7 years ago
3.2.1
7 years ago
3.2.0
7 years ago
3.1.0
7 years ago
3.0.0
7 years ago
2.2.2
7 years ago
2.2.1
7 years ago
2.2.0
8 years ago
2.1.0
8 years ago
2.0.2
8 years ago
2.0.1
8 years ago
1.9.0
8 years ago
1.8.2
8 years ago
1.8.1
8 years ago
1.8.0
8 years ago
1.7.2
8 years ago
1.7.1
8 years ago
1.7.0
8 years ago
1.6.3
8 years ago
1.6.2
8 years ago
1.6.1
8 years ago
1.6.0
8 years ago
1.5.1
8 years ago
1.5.0
8 years ago
1.4.1
8 years ago
1.4.0
8 years ago
1.3.0
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
1.0.0
8 years ago