0
The developers are too lazy to write docs (e.g. in jsdoc), so I'm trying to find some automatic solution.
I want to automatically create docs from
express.js api based on joi validation schema.
Is there a library or tool for it? Thanks
Example
For example from this pseudo code
router.post('/api', (req, res) => {
req.validate({
name: Joi.string().alphanum().min(2).max(30).required(),
surname: Joi.string().alphanum().min(2).max(30).required(),
birthYear: Joi.number().integer().min(1900).max(2013).required(),
mail: Joi.string().email()
});
res.json({ it: 'works.' });
});
generate doc, which will look like (I don't care about the exact form of output):
Api: POST /api
Parameters: name string[2-30, required] , surname string[2-30, required], birthYear int[1900-2013, required], mail string[email]
Response: 200 {it: 'works.'}
closed as off-topic by RobC, Cœur, bigreddot, Joshua Nozzi, LotPings Jul 20 at 18:15
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – RobC, Cœur, bigreddot, Joshua Nozzi, LotPings
Megjegyzések
Megjegyzés küldése