# NOT RUN {
if (requireNamespace("jsonvalidate", quietly = TRUE)) {
schema <- '{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"x": {
"type": "integer"
}
},
"required": ["x"]
}
'
json_valid <- '{
"x": 3
}'
json_invalid <- '{
"x": 1.5
}'
check_schema_json(json_valid, schema)
check_schema_json(json_invalid, schema)
}
# }
Run the code above in your browser using DataLab