I have the same need. That would be a good PR.
In the mean time, here's an ugly hack programmatically.
library(plumber)
pr <- pr()
pr$.__enclos_env__$private$globalSettings$info$version <- "4.0.0"
pr$run()
Less ugly hack by overwriting the spec using annotations
#* @plumber
function(pr) {
oas <- function(spec) {
spec$info$version <- packageVersion("plumber") |> as.character()
spec
}
pr$setApiSpec(oas)
}
#* @get /sample
function() {
"OK"
}