Skip to contents

Read an RDS file (default name _beekeeper_rapid.rds) with the API definition stored as a rapid::class_rapid() object. This file is generated by use_beekeeper() based on an OpenAPI definition file.

Usage

read_api_definition(
  pkg_dir = ".",
  rapid_filename = read_rapid_filename(pkg_dir)
)

Arguments

pkg_dir

(character(1) or fs_path) The directory containing package files.

rapid_filename

(character(1) or fs_path) The path to the R API definition (rapid) file (relative to the package root).

Value

(rapid::class_rapid) The definition of the API.

Examples

api_definition <- read_api_definition(fs::path_package("beekeeper", "guru"))
class(api_definition)
#> [1] "rapid::rapid" "S7_object"   
api_definition@info@origin@url
#> [1] "https://api.apis.guru/v2/openapi.yaml"