Summary
As an API-wrapping package developer, in order to parse simple JSON responses that aren't tibble-like, I'd like a simpler json tidier family.
Details
Right now, resp_tidy_json() always uses tibblify::tibblify(). Instead, rename R/resp_tidy_json.R and its test file to R/resp_tidy_json_tibblify.R and the corresponding test path, and rename the functions to resp_tidy_json_tibblify() and tidy_policy_json_tibblify() (and update calls). Then create a new R/resp_tidy_json.R and corresponding test file, with new resp_tidy_json() and tidy_policy_json(). The new, simpler resp_tidy_json() returns result or NULL directly, without calling tibblify::tibblify(), and doesn't have a spec nor an unspecified arg.
Once the new resp_tidy_json() exists, resp_tidy_json_tibblify() should be refactored to call resp_tidy_json() for everything other than the rlang::check_installed() and tibblify::tibblify() steps.
resp_tidy_json() should inherit the simplifyVector argument from httr2::resp_body_json() (and pass it along). When resp_tidy_json_tibblify() calls resp_tidy_json(), it should explicitly set simplifyVector = FALSE, in case we ever decide to default resp_tidy_json to simplifyVector = TRUE.
It's ok that this is a breaking change, since we haven't released this package yet.
Summary
Details
Right now,
resp_tidy_json()always usestibblify::tibblify(). Instead, renameR/resp_tidy_json.Rand its test file toR/resp_tidy_json_tibblify.Rand the corresponding test path, and rename the functions toresp_tidy_json_tibblify()andtidy_policy_json_tibblify()(and update calls). Then create a newR/resp_tidy_json.Rand corresponding test file, with newresp_tidy_json()andtidy_policy_json(). The new, simplerresp_tidy_json()returnsresultorNULLdirectly, without callingtibblify::tibblify(), and doesn't have aspecnor anunspecifiedarg.Once the new
resp_tidy_json()exists,resp_tidy_json_tibblify()should be refactored to callresp_tidy_json()for everything other than therlang::check_installed()andtibblify::tibblify()steps.resp_tidy_json()should inherit thesimplifyVectorargument fromhttr2::resp_body_json()(and pass it along). Whenresp_tidy_json_tibblify()callsresp_tidy_json(), it should explicitly setsimplifyVector = FALSE, in case we ever decide to defaultresp_tidy_jsontosimplifyVector = TRUE.It's ok that this is a breaking change, since we haven't released this package yet.