HTTP API package generator
Arguments
- pkg_path
(character) Path to the new package, where last part will be the package name
- template_path
(character) path to your yaml template file. by default, we use a demo template yaml file
- http_lib
(character) one of
crul
(default) orhttr
- base_url
(character) Base URL. If
NULL
, defaults tobaseUrl
or is formed fromschemes
,host
,basePath
as specified in the template file.
Examples
if (FALSE) { # \dontrun{
generate_pkg(pkg_path = "mypkg")
# from a Swagger spec
url <- "https://raw.githubusercontent.com/ropenscilabs/apispecs/master/swagger/crossref.yml"
# x <- paste0(readLines(url), collapse = "\n")
# yaml::yaml.load(string = x)
download.file(url, "crossref.yml")
my_dir <- file.path(tempdir(), "apples")
generate_pkg(pkg_path = my_dir, template_path = "crossref.yml")
} # }