koa-docs icon indicating copy to clipboard operation
koa-docs copied to clipboard

Not compatible with koa-joi-router 3.x

Open kevinludwig opened this issue 8 years ago • 4 comments

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
                }
            }
        }
    }
}

kevinludwig avatar May 25 '16 23:05 kevinludwig

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.

a-s-o avatar May 27 '16 23:05 a-s-o

Is there any process? I met the same issue.

miserylee avatar Sep 25 '16 14:09 miserylee

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.

a-s-o avatar Sep 25 '16 15:09 a-s-o

PR from miserylee merged which brings this up to koa-joi-router v4; not yet tested so I will live this issue open

a-s-o avatar Oct 03 '16 02:10 a-s-o