1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validate.R
\name{validate}
\alias{validate}
\title{Validate JSON}
\usage{
validate(txt)
}
\arguments{
\item{txt}{JSON string}
}
\description{
Test if a string contains valid JSON. Characters vectors will be collapsed into a single string.
}
\examples{
#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
}
|