You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After an extensive conversation with @schloerke, we've decided to add an edit parameter to the plumb_api() function. This parameter will open the plumber.R or entrypoint.R file associated with a specified Plumber API. This will enable Plumber users to quickly and easily view source code for Plumber APIs that are included in R packages.
The expected behavior of this feature is as follows:
plumb_api("plumber", "01-append", edit=TRUE)
A message is presented to the user specifying the path of the directory containing the source code and a warning that if they want to make persistent changes to the code, they should copy it to a separate file.
The associated plumber.R file is opened for editing
If using RStudio, the files pane is directed to the directory containing the source code
There were a few alternative options discussed that were ultimately rejected:
Copying the source directory to a temporary location and opening the files from there
This idea was based on preventing users from accidentally changing the behavior of API examples included with installed packages. It was ultimately decided that the simplest solution is to just open the original source file and provide the user with a warning about permanently editing the files.
Creating a separate pr_view_source() function.
This idea was based around the private $filename value for Plumber routers. The idea was to capture that filename and to open the source file. This approach was rejected in favor of adding edit to plumb_api() for simplicity sake. Using plumb_api() instead of introducing a new function also restricts this functionality to APIs included in installed packages, which is a desired characteristic.
The text was updated successfully, but these errors were encountered:
After an extensive conversation with @schloerke, we've decided to add an
edit
parameter to theplumb_api()
function. This parameter will open theplumber.R
orentrypoint.R
file associated with a specified Plumber API. This will enable Plumber users to quickly and easily view source code for Plumber APIs that are included in R packages.The expected behavior of this feature is as follows:
plumber.R
file is opened for editingThere were a few alternative options discussed that were ultimately rejected:
Copying the source directory to a temporary location and opening the files from there
This idea was based on preventing users from accidentally changing the behavior of API examples included with installed packages. It was ultimately decided that the simplest solution is to just open the original source file and provide the user with a warning about permanently editing the files.
Creating a separate
pr_view_source()
function.This idea was based around the private
$filename
value for Plumber routers. The idea was to capture that filename and to open the source file. This approach was rejected in favor of addingedit
toplumb_api()
for simplicity sake. Usingplumb_api()
instead of introducing a new function also restricts this functionality to APIs included in installed packages, which is a desired characteristic.The text was updated successfully, but these errors were encountered: