I am switching my APIs to a more organized and scalable structure and I'd like to change some annotated endpoints to a "programmatic usage" in order to use routes.
How can I add the same endpoint documentation via pr that I would via annotations? Is there a way to add it manually in the endpoints function and somehow "generate" a swagger file in the end?
Just for clarity, what I want is to transform this:
#* Say hello
#* @get /hello
#* @param name Name
#* @tag silly
function(name){
paste("Hello", name)
}
Into something like (with annotations):
pr$handle("GET", "/hello", function(req, res, name) {
....
})
Thanks!
PS: As a bonus, how can I add the global API documentation when using pr?
#* @apiTitle My API
#* @apiVersion 0.0.1
#* @apiDescription No Description