a-s-o / koa-docs

An automatic documentation generator for koa.js APIs
MIT License
79 stars 16 forks source link

Not compatible with koa-joi-router 3.x #4

Open kevinludwig opened 8 years ago

kevinludwig commented 8 years ago

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
                }
            }
        }
    }
}
a-s-o commented 8 years ago

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.

miserylee commented 8 years ago

Is there any process? I met the same issue.

a-s-o commented 8 years ago

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 commented 8 years ago

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