Skip to content

resp_tidy_json() vs resp_tidy_json_tibblify() #95

Description

@jonthegeek

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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions