# NOT RUN {
#Output from toJSON and serializeJSON should pass validation
myjson <- toJSON(mtcars)
validate(myjson) #TRUE
#Something bad happened
truncated <- substring(myjson, 1, 100)
validate(truncated) #FALSE
# }
Run the code above in your browser using DataLab