-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Un-deprecate Plumber$run(swaggerCallback=, debug=)
and add Plumber$run(docs=,quiet=)
#765
Conversation
To better support headless running scenarios
This would probably work too pr() %>% pr_set_docs_callback(NULL) %>% pr_run(quiet = TRUE) It made realize options_plumber(docs.callback = NULL) # Whole session
pr() %>% pr_run(quiet = TRUE) As it is we still default to it when initializing the router. I liked the idea of distanciating the package from the swagger ui by using more general names. |
@jcheng5 Would Connect ever want access to If no, then it seems like an appropriate place to put the
While we do not need to implement the |
Talking more with Might be good to add a tl/dr; Put quiet in |
Running an headless plumber would make a lot of people happy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should revert the swaggerCallback changes and also insert ...
so that quiet
must be full named.
R/plumber.R
Outdated
#' @param swaggerCallback An optional single-argument function that is | ||
#' called back with the URL to an OpenAPI user interface when one becomes | ||
#' ready. If missing, defaults to `$setDocsCallback()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' @param swaggerCallback An optional single-argument function that is | |
#' called back with the URL to an OpenAPI user interface when one becomes | |
#' ready. If missing, defaults to `$setDocsCallback()`. | |
#' @param swaggerCallback Deprecated. See `$setDocsCallback()` |
R/plumber.R
Outdated
#' @importFrom lifecycle deprecated | ||
run = function( | ||
host = '127.0.0.1', | ||
port = getOption('plumber.port', NULL), | ||
swagger = deprecated(), | ||
debug = deprecated(), | ||
swaggerCallback = deprecated() | ||
swaggerCallback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add in ...
swaggerCallback, | |
swaggerCallback = deprecated(), | |
..., |
R/plumber.R
Outdated
if (missing(swaggerCallback)) { | ||
swaggerCallback <- private$docs_callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (missing(swaggerCallback)) { | |
swaggerCallback <- private$docs_callback | |
if (lifecycle::is_present(swaggerCallback)) { | |
lifecycle::deprecate_warn("1.0.0", "run(swaggerCallback = )", "setDocsCallback(callback = )") | |
self$setDocsCallback(swaggerCallback) |
R/pr.R
Outdated
#' @param swaggerCallback An optional single-argument function that is called | ||
#' back with the URL to an OpenAPI user interface when one becomes ready. If | ||
#' missing, defaults to `$setDocsCallback()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#' @param swaggerCallback An optional single-argument function that is called | |
#' back with the URL to an OpenAPI user interface when one becomes ready. If | |
#' missing, defaults to `$setDocsCallback()`. |
R/pr.R
Outdated
@@ -488,11 +492,15 @@ pr_filter <- function(pr, | |||
#' @export | |||
pr_run <- function(pr, | |||
host = '127.0.0.1', | |||
port = getOption('plumber.port', NULL) | |||
port = getOption('plumber.port', NULL), | |||
swaggerCallback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
swaggerCallback, | |
..., |
NEWS.md
Outdated
@@ -23,6 +23,8 @@ plumber 1.0.0.9999 Development version | |||
|
|||
* OpenAPI Specification can be set using a file path. (@meztez #696) | |||
|
|||
* Added `quiet = TRUE` to `Plumber$run()` to suppress routine startup messages. (@jcheng5 #765) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Added `quiet = TRUE` to `Plumber$run()` to suppress routine startup messages. (@jcheng5 #765) | |
* Added `quiet = TRUE` to `pr_run()` and `Plumber$run()` to suppress routine startup messages. (@jcheng5 #765) |
`debug`, `swaggerCallback`, and `docs` Add `...` and check that it is empty
Plumber$run(swaggerCallback=, debug=)
and add Plumber$run(docs=,quiet=)
I am going to resolve all requested changes above as they are not to be used. |
LGTM! |
* master: Un-deprecate `Plumber$run(swaggerCallback=, debug=)` and add `Plumber$run(docs=,quiet=)` (#765) Add `PlumberEndpoint$setPath(path)` (#770) Setting `plumber.docs.callback` to `NULL` will also set legacy `plumber.swagger.url` (#766) Update Hosting vignette to swap RStudio Connect and Digital Ocean (#774) Use `pak` for GHA (#771) Clarify parameters documentation on when plumber perform type conversion (#756) fix brew cask install actions (#761)
To better support headless running scenarios. Specifically, I'm creating unit tests for plumbertableau that do not involve using an additional process.
Minimal reproducible example
PR task list:
devtools::document()