# A simple string
'"string"' %>% json_schema %>% writeLines
# A simple object
'{"name": "value"}' %>% json_schema %>% writeLines
# A more complex JSON array
json <- '[{"a": 1}, [1, 2], "a", 1, true, null]'
# Using type = 'string' (default)
json %>% json_schema %>% writeLines
# Using type = 'value' to show a representative value
json %>% json_schema(type = "value") %>% writeLines
# Schema of the first 5 github issues
if (FALSE) {
library(dplyr)
issues %>% gather_array %>% slice(1:10) %>%
json_schema(type = "value") %>% writeLines
}
Run the code above in your browser using DataLab