jonthegeek / wapir

Web APIs with R
https://wapir.io/
22 stars 3 forks source link

Task: Create a tibble of all endpoints in the "fec.gov" API. #66

Open jonthegeek opened 7 months ago

jonthegeek commented 7 months ago
# Note: I'm using the dev version of tibblify, pak::pak("mgirlich/tibblify#191")
all_apis$fec.gov$versions$`1.0`$swaggerUrl
fec_paths <- tibblify::parse_openapi_spec(
  all_apis$fec.gov$versions$`1.0`$swaggerUrl
)
fec_paths

fec_paths$operations |> lengths() |> unique()
fec_paths$operations[[1]]
fec_paths$operations |> 
  purrr::map_int(nrow) |> 
  unique()

fec_operations <- fec_paths |> 
  tidyr::unnest_wider(operations)
fec_operations
fec_operations$parameters[[1]]
fec_operations$global_parameters[[1]]