Open meowcat opened 2 years ago
This should work. source()
ing only does a standard R source on the files. We need to plumb the files to get its contents ready for plumber
.
api2_pr <- plumber::plumb("api2.R")
#* @get /test
function() {
return("1")
}
#* @plumber
function(pr) {
plumber::pr_mount(pr, "/", api2_pr)
}
System details
Output of
sessioninfo::session_info()()
:Example application or steps to reproduce the problem
plumber.R
api2.r
Run
Swagger only shows
/test
but not/test2
; also the query to/test2
fails.Describe the problem in detail
Plumber doesn't follow into
api2.R
to find annotation entries there, so I would instead have to have everything in the same file. I would like to split up my api into multiple files. This is really for legibility and not for some stricter isolation purposes; in particular, there is some global state involved in practice.