if (FALSE) {
# create operation and schema functions
api_url <- "http://petstore.swagger.io/v2/swagger.json"
api <- get_api(api_url)
operations <- get_operations(api)
schemas <- get_schemas(api)
# get operations which return content or stop on error
operations <- get_operations(api, handle_response = content_or_stop)
# use .headers when operations must send additional headers when sending
operations <-
get_operations(api, .headers = c("api-key" = Sys.getenv("SOME_API_KEY")))
}
Run the code above in your browser using DataLab