Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON validation back in once jsonlite is updated #19

Open
jeremystan opened this issue Nov 1, 2014 · 0 comments
Open

Add JSON validation back in once jsonlite is updated #19

jeremystan opened this issue Nov 1, 2014 · 0 comments

Comments

@jeremystan
Copy link

'jsonlite::validate' leaves global error data that is picked up later by 'jsonlite::fromJSON' for JSON 'false' values. See resolved issue for 'jsonlite' here: jeroen/jsonlite#49

Once that issue is released, need to update dependencies and add JSON validation back in, reversing this commit:

(ds)MBP0366:tidyjson jeremystanley$ git diff HEAD~1
diff --git a/R/tbl_json.r b/R/tbl_json.r
index 161dd15..c957234 100644
--- a/R/tbl_json.r
+++ b/R/tbl_json.r
@@ -50,12 +50,6 @@ as.tbl_json.tbl_json <- function(x, ...) x
 #' @export
 as.tbl_json.character <- function(x, ...) {

-  # Check for valid
-  is_valid <- vapply(x, validate, logical(1))
-
-  if (any(!is_valid))
-    stop(sprintf("%s records have invalid json data", sum(!is_valid)))
-
   # Parse the json
   json <- lapply(x, fromJSON, simplifyVector = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant