koa-docs
koa-docs copied to clipboard
Not compatible with koa-joi-router 3.x
The HTML doc is incorrect when the application happens to use koa-joi-router 3.x. The basic issue is that 2.x expects a route definition to look like this:
{
validations: {
output: {
// the schema here
}
}
}
And the 3.x route definition looks like this:
{
validations: {
output: {
200: { // single status code
body: {
// returned body schema
},
headers: {
// returned header schema
}
},
"400,403": { // range of status codes..
body: {
// error body
},
headers: {
// error headers
}
}
}
}
}
Hey, thanks for reporting that. Well, I have a few specs using joi router 2 which I don't foresee re-factoring any time soon. In the meantime, I will add support for both version 2 and version 3 specs. I will update later what kind of progress I make.
Is there any process? I met the same issue.
Hi, busy with a few other things at the moment. My apps are still using the old Joi router so i have not had the need to upgrade. I would appreciate a pull request from some using joi router v3.
PR from miserylee merged which brings this up to koa-joi-router v4; not yet tested so I will live this issue open