Learn R Programming

validatejsonr (version 1.0.4)

validate_json_with_schemafile: Validate a JSON string against a JSON Schema file

Description

Description

Usage

validate_json_with_schemafile(json_string, schemafn)

Arguments

json_string
The JSON code
schemafn
The JSON Schema file This function will check that the supplied schema file is not empty and is accessible and it will then validate that the JSON code is valid (and well formed) against the supplied schema file.

Examples

Run this code
## Not run: 
# json_code <- "{\"category\": \"book\", \"price\": 25,  \"title\": \"abrakadabra\"}"
# validate_json_with_schemafile(json_code, "data/schema.json")
# ## End(Not run)

Run the code above in your browser using DataLab