rstudio / plumber

Turn your R code into a web API.
https://www.rplumber.io
Other
1.39k stars 255 forks source link

Add programatic OAS title / description / version #576

Open schloerke opened 4 years ago

schloerke commented 4 years ago

https://community.rstudio.com/t/adding-endpoint-documentation-from-programmatic-usage-in-plumber/71271

As a bonus, how can I add the global API documentation when using pr?

#* @apiTitle My API
#* @apiVersion 0.0.1
#* @apiDescription No Description
jlfsjunior commented 4 years ago

Thanks! Please ping me if you need some user feedback in all the PRs/issues you are working now. I'd be happy to help! 😄

meztez commented 4 years ago

maybe pr$setApiGlobals(info, host, tags, ...) to modify private$globalsSettings globals and the other one are already availabe through PlumberEndpoint but undocumented.

meztez commented 3 years ago

Would that be sufficient?

pr() %>%
  pr_set_api_spec(function(spec) {
  spec$info = list(
    description = "API Description G",
    title = "API Title XXX", 
    version = "5.5.5")
  spec
  }) %>%
  pr_run()