简体   繁体   中英

how to generate documentation on parse server application

I was wondering if we can generate documentation based on our schema/classes in our parse server powered express application.

Also I have around 15 cloud functions which need to have specific post body. It'd be great to have documentation generator

I don't know of any APIDOC generator for Parse class schemas. A good starting point, however, might be the Schema APIs which allow you to fetch a JSON description of the class schemas in your app. They return a simple format which you can transform and feed into a documentation tool of your choice.

For Cloud Code functions, there's no way to do anything automated IMO: the parameters to and the results from a function are not defined explicitly anywhere, the function just gets and returns plain JavaScript objects -- as long as it can handle the request params and the client can handle the response, it works. As a workaround -- again -- you could write your Cloud Code functions as plain functions, annotate them with one of the many JS type information systems (or even use TypeScript), thus enabling the use of APIDOC tools; these plain functions are expose to Parse via a simple wrapper which handles the translation from the request object to the function's input parameters and from the function's result (or error) to the response object.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM