outmoded / lout

API documentation generator
Other
276 stars 49 forks source link

Payload params shows for GET routes #71

Closed johnbrett closed 10 years ago

johnbrett commented 10 years ago

Lout by default shows "Type any" for Path, Query and Payload parameters by default, but Hapi doesn't accept a payload for a GET request. Is it possible to remove this? I tried:

validate: {
     payload: false
}

On a route, but Hapi will return a "Cannot Validate" error since it's a GET. If there's nothing I can do config wise to fix this, should I submit a PR to disable the section from being generated for GETs by default?

I think it would be handy if we had a way disable this from being generated for POST, and other methods as well...

PaulMougel commented 10 years ago

Moreover, if query, params or payload are set to false, they are displayed as

Type:
    Object

instead of "disabled" or "not allowed"

johnbrett commented 10 years ago

I submitted a PR https://github.com/spumko/lout/pull/72 for the GET request issue. I'll look at making one for the validation set to false use case too.

Marsup commented 10 years ago

I've pushed in master a few fixes but it requires hapi 6.x. It should fix all those type any, so I'm not sure I'm gonna merge that #72. Still investigating why false gives an object though.

Marsup commented 10 years ago

false case should also be handled now, test it and let me know if everything's fine.

Marsup commented 10 years ago

I've published a new version as previously said compatible with hapi 6.x, I'll close this issue as it seems resolved but feel free to ping if you don't think so.