Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions R/generate_pkg-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@

.read_config <- function(config_file = "_beekeeper.yml") {
config <- yaml::read_yaml(config_file)
return(.stabilize_config(config)) # nocov
return(.stabilize_config(config))
}

# covr doesn't see the line above and a bunch below for some reason.
# nocov start
.stabilize_config <- function(config) {
config$api_title <- stbl::stabilize_character_scalar(config$api_title)
config$api_abbr <- stbl::stabilize_character_scalar(config$api_abbr)
Expand All @@ -49,7 +47,6 @@
)
return(config)
}
# nocov end

.read_api_definition <- function(pkg_dir, rapid_file) {
readRDS(
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
65 changes: 33 additions & 32 deletions data-raw/oas_format_registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,47 +40,48 @@ oas_format_registry <-
# nectar re-exports from stbl, and adds HTTP-specific wrappers
to_r = dplyr::case_when(
## Null
.data$type == "null" ~ "stabilize_null",
.data$type == "null" ~ "todo_to_null",
## Numbers
.data$format == "int64" ~ "stabilize_int64",
stringr::str_detect(.data$format, "int") ~ "stabilize_int",
stringr::str_detect(.data$type, "int") ~ "stabilize_int",
.data$type == "number" ~ "stabilize_dbl",
stringr::str_detect(.data$format, "decimal") ~ "stabilize_dbl",
.data$format == "int64" ~ "todo_to_int64_scalar",
stringr::str_detect(.data$format, "int") ~ "to_int_scalar",
stringr::str_detect(.data$type, "int") ~ "to_int_scalar",
.data$type == "number" ~ "to_dbl_scalar",
stringr::str_detect(.data$format, "decimal") ~ "to_dbl_scalar",
## Dates and times
.data$format %in% c("date", "http-date") ~ "stabilize_date",
.data$format == "date-time" ~ "stabilize_datetime",
.data$format == "duration" ~ "stabilize_duration",
.data$format == "time" ~ "stabilize_time",
.data$format %in% c("date", "http-date") ~ "todo_to_date_scalar",
.data$format == "date-time" ~ "todo_to_datetime_scalar",
.data$format == "duration" ~ "todo_to_duration_scalar",
.data$format == "time" ~ "todo_to_time_scalar",
## Binary
.data$format %in% c("byte", "sf-binary") ~ "stabilize_base64_to_chr",
.data$format == "binary" ~ "stabilize_binary_to_raw",
.data$format == "base64url" ~ "stabilize_base64url_to_chr",
.data$format %in%
c("byte", "sf-binary") ~ "todo_stabilize_base64_to_chr_scalar",
.data$format == "binary" ~ "todo_stabilize_binary_to_raw",
.data$format == "base64url" ~ "todo_stabilize_base64url_to_chr_scalar",
## Logical
.data$format == "sf-boolean" ~ "stabilize_structured_lgl",
.data$type == "boolean" ~ "stabilize_lgl",
.data$format == "sf-boolean" ~ "todo_to_structured_lgl_scalar",
.data$type == "boolean" ~ "to_lgl_scalar",
## Specific Strings
.data$format == "uuid" ~ "stabilize_uuid",
.data$format == "uuid" ~ "todo_to_uuid_scalar",
# TODO: Add more specific string formats.
.default = "stabilize_chr"
.default = "to_chr_scalar"
),
r_class_name = dplyr::replace_values(
.data$to_r,
"stabilize_base64_to_chr" ~ "character",
"stabilize_base64url_to_chr" ~ "character",
"stabilize_binary_to_raw" ~ "raw",
"stabilize_chr" ~ "character",
"stabilize_date" ~ "Date",
"stabilize_datetime" ~ "POSIXct",
"stabilize_dbl" ~ "double",
"stabilize_duration" ~ "Duration",
"stabilize_int" ~ "integer",
"stabilize_int64" ~ "integer64",
"stabilize_lgl" ~ "logical",
"stabilize_null" ~ "NULL",
"stabilize_structured_lgl" ~ "logical",
"stabilize_time" ~ "hms",
"stabilize_uuid" ~ "UUID"
"todo_stabilize_base64_to_chr_scalar" ~ "character",
"todo_stabilize_base64url_to_chr_scalar" ~ "character",
"todo_stabilize_binary_to_raw" ~ "raw",
"to_chr_scalar" ~ "character",
"todo_to_date_scalar" ~ "Date",
"todo_to_datetime_scalar" ~ "POSIXct",
"to_dbl_scalar" ~ "double",
"todo_to_duration_scalar" ~ "Duration",
"to_int_scalar" ~ "integer",
"todo_to_int64_scalar" ~ "integer64",
"to_lgl_scalar" ~ "logical",
"todo_to_null" ~ "NULL",
"todo_to_structured_lgl_scalar" ~ "logical",
"todo_to_time_scalar" ~ "hms",
"todo_to_uuid_scalar" ~ "UUID"
),
r_class_package = dplyr::recode_values(
.data$r_class_name,
Expand Down
Loading