Defines a terminal handler in a Plumber router.
Parameters values are obtained from parsing blocks of lines in a plumber file. They can also be provided manually for historical reasons.
a character vector. http methods. For historical reasons we have to accept multiple verbs for a single path. Now it's simpler to just parse each separate verb/path into its own endpoint, so we just do that.
a character string. endpoint path
step allowed parsers
ability to serve request
determines if route matches requested path
Create a new
PlumberEndpoint$new( verbs, path, expr, envir, serializer, parsers, lines, params, comments, description, responses, tags, srcref )
Endpoint verb Ex:
Endpoint path. Ex:
Endpoint function or expression that evaluates to a function.
Endpoint serializer. Ex:
Can be one of:
A character vector of parser names
TRUEvalue, which will default to combining all parsers. This is great for seeing what is possible, but not great for security purposes
If the parser name
"all"is found in any character value or list name, all remaining parsers will be added. When using a list, parser information already defined will maintain their existing argument values. All remaining parsers will use their default arguments.
# provide a character string parsers = "json" # provide a named list with no arguments parsers = list(json = list()) # provide a named list with arguments; include `rds` parsers = list(json = list(simplifyVector = FALSE), rds = list()) # default plumber parsers parsers = c("json", "form", "text", "octet", "multi")
comments, description, responses, tags
Values to be used within the OpenAPI Spec
srcrefattribute from block
retrieve endpoint path parameters
retrieve endpoint expression parameters
retrieve endpoint defined parameters
$path with a sanitized
path and updates the internal path meta-data