From 6beed25ade1d2b7bd3bef1f23cdb472ac3710094 Mon Sep 17 00:00:00 2001 From: Cameron Hurd Date: Tue, 4 Oct 2016 07:44:46 -0400 Subject: [PATCH] Add a `use` statment that had tripped an SO user up: http://stackoverflow.com/a/39851294/1779433 --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 62f0fbd..e05aa7f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -This library provides JSON schema validation using the schema found at http://json-schema.org. +This library provides JSON schema validation using the schema found at http://json-schema.org. Note that it is not yet feature complete, but does support basic validation. The JSON schema draft can be found at http://tools.ietf.org/html/draft-zyp-json-schema-03 @@ -7,11 +7,13 @@ draft can be found at http://tools.ietf.org/html/draft-zyp-json-schema-03 ## Usage + use Json\Validator as JsonValidator; + $someJson = '{"foo":"bar"}'; $jsonObject = json_decode($someJson); - + $validator = new JsonValidator('/path/to/yourschema.json'); - + $validator->validate($jsonObject); @@ -59,4 +61,4 @@ The following definitions are not yet supported: - extends - id - $ref -- $schema \ No newline at end of file +- $schema