-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discussion: introspect services for pre and post hooks, and other routes #81
Comments
I like the idea you mentioned on Slack of parsing JSDoc style comments to generate the documentation. Some questions to investigate are:
|
|
I would think that at the least, we would introspect for the following:
Other considerations?
One use case: A package like What other thoughts? |
@daffl did a little bit of research here... introspecting hooks could work. Changing one of the feathers conventions to have hooks return named functions as would be one way - e.g.
Would become
This is may not be intuitive/obvious. Another approach would be to wrap the hook
With this approach, maybe the common hooks give obvious documentation signals. |
Custom hooks could still export their own docs I think. Something like const document = require('feathers-api-doc');
/**
* A hook method
*/
module.exports = function hookMethod(method) {
}
module.exports.docs = document(__dirname); Basically anything that has a |
totally - and what is the purpose of passing |
Oops, that should've been |
oh - got it. So, |
Any custom generation of docs should by handled by independet packages. |
Should we automate documentation of pre and post hooks? All hooks, or just often used hooks
Should we introspect services (or even the underlying app) for routes not defined in the service itself?
@daffl - https://feathersjs.slack.com/archives/C52QSFK0A/p1507333034000102
I think the conversation is worth having. Maybe we decide that automation/automated introspection is not the answer, and maybe just more robust documentation on the best way to use swagger to document hook like functionality.
Thanks for all of the great work!!
The text was updated successfully, but these errors were encountered: