From 6a199999ac8e87e30e41d0445c9e52035e6121db Mon Sep 17 00:00:00 2001 From: Jon Harmon Date: Thu, 14 May 2026 06:48:20 -0500 Subject: [PATCH] Update `oas_format_registry` with better function names `to_r` now better describes my current thoughts --- R/generate_pkg-setup.R | 5 +-- R/sysdata.rda | Bin 906 -> 915 bytes data-raw/oas_format_registry.R | 65 +++++++++++++++++---------------- 3 files changed, 34 insertions(+), 36 deletions(-) diff --git a/R/generate_pkg-setup.R b/R/generate_pkg-setup.R index 7354a2a..035e6a9 100644 --- a/R/generate_pkg-setup.R +++ b/R/generate_pkg-setup.R @@ -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) @@ -49,7 +47,6 @@ ) return(config) } -# nocov end .read_api_definition <- function(pkg_dir, rapid_file) { readRDS( diff --git a/R/sysdata.rda b/R/sysdata.rda index 9698cd2a5a630471c5f9e6c1f07e0bb8946afea6..b8129827b253f345f83d07542d9a0a3a0c34757c 100644 GIT binary patch literal 915 zcmV;E18n?4T4*^jL0KkKSxg+1$N&aKf5iX)&V~sCJwyd1-axH1ONa5&;$JN zmazZ|V3d^@0iia5pwKj!MgRaFpdOIpCQO)&OaPfMOn@3Ni~$S>88T$VVqgTxf@A>E zgkT6@5k)d6!f4dVrqM8gp{AG(35aA5OrVhl$)U1<8%WU8^+0H>Xi5gA zwj3adYy*yxDyKyPKs;eVgT%|L*=?%n4RmL!-RB@^z4_vzf)1SyC_F5X7#f%!v54?_ zw2_0o(P-=aX`peO%zSA~ZR?Rj@r)nbL7a)mN{w(54v~fw&{ss3SClLPg9Gdt7uGDS zbXc+D=!7iLf2@LwHA6H1OD6}h1fYrps;^r~c(@y93Oaa1pP~^rVrfHj8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C&l8Ic_qRo(1tbL(zhAB8&#cSRNb5mN?*$1#YH zHh^Ze09{XuNp`pm%-Iv)LwPzW!U8x_5$7WQLkZah$e`jO4|z|BAgGL!lgvv1f>nfC z(vlb0@pPa#f=j=$TTM0~et?d;A!bupXd`$bSRrDI?#U(7#F!ylVS}!SSzTqE;3Fw2 zNYzn-K`zPf#kP>Nu_3`S^Z~y>$?c;80GAqarUejh3Uvl4*m!x#1{sFz?p|E_mjlD5>{ax+3kfG2U|AT1sGd63Jj3w zsT?*)5s<}X1ePaGV^C_Wp&9NfKwl;_Hho}eyG4J3ahq(~GJ`ix>lH&limf421eWT$ zkQourYFh}@bXFV;Hl90-OhFp#&DYtJsJPdWparef6bb>r_e>D4tDrrFc*aKQf7TaJ z*^USjq~!|idU-<2bC5ZP1QVkgyvgX1OwoX}sbB%LErXA%Gak?pvtF$Cc0XYR1cn4j z0!wvK;L;`lS5P59k2CS;ww;cIeb*CIx$cre4z*h71RK$ek^?eCKw=tRFw2WzY4C_w gSY>iiW(^8}gic5aX4;rZG-Cf3az!{$kRmH(yuiAESpWb4 diff --git a/data-raw/oas_format_registry.R b/data-raw/oas_format_registry.R index e765afe..405da66 100644 --- a/data-raw/oas_format_registry.R +++ b/data-raw/oas_format_registry.R @@ -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,