On Github mikaa123 / catnap-talk
@_ms123
Lets you document APIs in a human-readable way.
The resulting documentation is processable by machines.
By giving examples
An API-Blueprint parser creates an AST.
This AST is used to create wonderous tooling!
Resources
some service that lives at a URI and that has one or more representations.
HTTP transactions
The actual state of the resource, represented according to a
media type
Let's you do just that.
var userResource = makeResource('user', '/users/:userId')
Define representations
.representation(function (user) { return pick(user, 'username', 'email'); })
.representation('partial', function (user) { return pick(user, 'username'); })
Define actions
.get(function (req, res) { User.findOne({ _id: req.params.userId }, function (err, user) { user && res.send(200, userResource(user)); }); });
Makes API-Blueprint concepts first-class citizen in our code
—Daniel Jackson, MIT Professor
Takes your API-Blueprint documentation,
and runs your examples against your actual code
╰(*´︶`*)╯
Integrates well with continuous integration systems.
Generate code from your documentation
TDD the resulting code with Dredd