plumber v1.1.0
Breaking changes
-
Force json serialization of endpoint error responses instead of using endpoint serializer. (@meztez, #689)
-
When plumbing a Plumber file and using a Plumber router modifier (
#* @plumber
), an error will be thrown if the original router is not returned. (#738) -
options_plumber()
now requires that all options are named. If no option name is provided, an error with be thrown. (#746)
New features
-
Added option
plumber.trailingSlash
. This option (which is disabled by default) allows routes to be redirected to route definitions with a trailing slash. For example, if aGET
request is submitted to/test?a=1
with no/test
route is defined, but aGET
/test/
route definition does exist, then the original request will respond with a307
to reattempt againstGET
/test/?a=1
. This option will be enabled by default in a future release. This logic executed for before calling the404
handler. (#746) -
Added an experimental option
plumber.methodNotAllowed
. This option (which is enabled by default) allows for a status of405
to be returned if an invalid method is used when requesting a valid route. This logic executed for before calling the default404
handler. (#746) -
Passing
edit = TRUE
toplumb_api()
will open the API source file. (#699) -
OpenAPI Specification can be set using a file path. (@meztez #696)
-
Guess OpenAPI response content type from serializer. (@meztez #684)
-
Undeprecated
Plumber$run(debug=, swaggerCallback=)
and added the parameters forPlumber$run(docs=, quiet=)
andpr_run(debug=, docs=, swaggerCallback=, quiet=)
. Now, all four parameters will not produce lingering effects on thePlumber
router. (@jcheng5 #765)- Setting
quiet = TRUE
will suppress routine startup messages. - Setting
debug = TRUE
, will display information when an error occurs. Seepr_set_debug()
. - Setting
docs
will update the visual documentation. Seepr_set_docs()
. - Set
swaggerCallback
to a function which will be called with a url to the documentation, orNULL
to do nothing. Seepr_set_docs_callback()
.
- Setting
-
To update a
PlumberEndpoint
path after initialization, call the newPlumberEndpoint$setPath(path)
. This will update internal path matching meta data. (Active bindings were not used to avoid breaking changes.) (@blairj09 #770) -
PlumberStep
(andPlumberEndpoint
andPlumberFilter
) received a new field$srcref
and method$getFunc()
.$srcref
will contain the correspondingsrcref
information from original source file.$getFunc()
will return the evaluated function. (#782) -
Allow for spaces in
@apiTag
and@tag
when tag is surrounded by single or double quotes. (#685)
Bug fixes
-
Block parsing comments, tags and responses ordering match plumber api ordering. (#722)
-
Fixed bug where
httpuv
would return a status of500
with bodyAn exception occurred
if no headers were set on the response object. (#745) -
Fixed bug where all
pr_*()
returned invisibly. Now allpr_*()
methods will print the router if displayed in the console. (#740) -
When calling
Plumber$handle()
and defining a newPlumberEndpoint
,...
will be checked for invalid names. (@meztez, #677) -
/__swagger__/
now always redirects to/__docs__/
, even when Swagger isn't the selected interface. Useoptions(plumber.legacyRedirects = FALSE)
to disable this behavior. (@blairj09 #694) -
Fixed
available_apis()
bug where all packages printed all available APIs. (@meztez #708) -
Fixed Plumber
$routes
resolution bugs. Routes are now returned in lexicographical order. (@meztez #702) -
Plumber will now display a circular reference if one is found while printing. (#738)
-
Changed
future::plan()
frommultiprocess
tomultisession
in example API14-future
as "Strategy 'multiprocess' is deprecated in future (>= 1.20.0)". (#747) -
Setting options
plumber.docs.callback
toNULL
will also set deprecated but supported optionplumber.swagger.url
. (#766)