diegohaz/rest

"How to" question about custom methods in schema

mickey58github opened this issue · 0 comments

Hi Diego, this is great work. I'm currently evaluating to use your REST generator package in my Mongoose project. I have a Mongoose schema that defines a tree structure. It's a recursive schema that uses references to the same schema for the children of a parent node in the tree. The schema has, besides usual CRUD methods, some special methods for tree handling, like getChildren(), getImmediateChildren() getParent(), getAncestors() etc. My question: Will your package automatically generate REST APIs for such custom chema methods already defined in my schema, from their method signatures and code? Do you have an example for that? Alternatively, can you give me some hints where and how to add such custom methods to the files generated by your package?

Thanks a lot, Michael