plumber
plumber copied to clipboard
Feature request: add inheritParams functionality
The roxygen2 tag @inheritParams is used to grab & reuse documentation written elsewhere. http://r-pkgs.had.co.nz/man.html A similar type of tag would be a great feature to have in Plumber!
This comes in handy if you:
- have several functions in the API with the same parameters (for example, if you have a
user_idparameter that is used in several functions) - wrap a function with documentation written out elsewhere
For example, you could do this:
#* Paste API
#* @inheritParams base::paste
#* @get /paste
function(..., sep = " ", collapse = NULL){
paste(..., sep = sep, collapse = collapse)
}
rather than this:
#* Paste API
#* @param ... one or more R objects
#* @param sep a character string to separate the terms
#* @param collapse an optional character string to separate the results
#* @get /paste
function(..., sep = " ", collapse = NULL){
paste(..., sep = sep, collapse = collapse)
}