Skip to content

Commit df57216

Browse files
Update readme for draft 7 (#899)
## Description Updates the Readme.md to include info about the Draft-7 support ## Related Issue N/A ## Type of Change <!-- Mark the appropriate option with an "x" --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [X] Documentation update - [ ] Code refactoring - [ ] Other (please describe): ## Checklist <!-- Mark completed items with an "x" --> - [X] I have read the [CONTRIBUTING](CONTRIBUTING.md) guidelines - [X] My code follows the code style of this project - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] All new and existing tests pass - [X] I have updated the documentation accordingly - [X] My changes generate no new warnings ## Additional Notes <!-- Add any additional information that might be helpful for reviewers -->
1 parent d5235a3 commit df57216

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
![Supported Dialects](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fsupported_versions.json)
77

88
A PHP Implementation for validating `JSON` Structures against a given `Schema` with support for `Schemas` of Draft-3,
9-
Draft-4 or Draft-6.
9+
Draft-4, Draft-6 or Draft-7.
1010

1111
Features of newer Drafts might not be supported. See [Table of All Versions of Everything](https://json-schema.org/specification-links.html#table-of-all-versions-of-everything) to get an overview
1212
of all existing Drafts. See [json-schema](http://json-schema.org/) for more details about the JSON Schema specification
@@ -15,6 +15,7 @@ of all existing Drafts. See [json-schema](http://json-schema.org/) for more deta
1515
![Draft 3](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft3.json)
1616
![Draft 4](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft4.json)
1717
![Draft 6](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft6.json)
18+
![Draft 7](https://img.shields.io/endpoint?url=https%3A%2F%2Fbowtie.report%2Fbadges%2Fphp-justinrainbow-json-schema%2Fcompliance%2Fdraft7.json)
1819

1920

2021
## Installation
@@ -37,17 +38,17 @@ composer require justinrainbow/json-schema
3738

3839
For a complete reference see [Understanding JSON Schema](https://json-schema.org/understanding-json-schema/).
3940

40-
__Note:__ features of Drafts newer than Draft-4 might not be supported!
41+
__Note:__ Not all drafts might be supported, check the [Bowtie report](https://bowtie.report/#/implementations/php-justinrainbow-json-schema) on the current state of draft implementations.
4142

4243
### Basic usage
4344

4445
```php
4546
<?php
4647

47-
$data = json_decode(file_get_contents('data.json'));
48+
$data = json_decode(file_get_contents('data.json'), false);
4849

4950
// Validate
50-
$validator = new JsonSchema\Validator;
51+
$validator = new JsonSchema\Validator();
5152
$validator->validate($data, (object)['$ref' => 'file://' . realpath('schema.json')]);
5253

5354
if ($validator->isValid()) {
@@ -231,4 +232,4 @@ Thanks go to these wonderful people, without their effort this project wasn't po
231232

232233
<a href="https://github.com/jsonrainbow/json-schema/graphs/contributors">
233234
<img src="https://contrib.rocks/image?repo=jsonrainbow/json-schema" />
234-
</a>
235+
</a>

0 commit comments

Comments
 (0)