-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add URI translation for retrieval & add local copies of spec schema * Add use line for InvalidArgumentException & adjust scope (#372) Fixes issue #371 * add quiet option (#382) * add quiet option * use verbose instead of quiet * add quiet option * always output dump-schema * always output dump-schema-url * fix typo and ws * [BUGFIX] Add provided schema under a dummy / internal URI (fixes #376) (#378) * Add provided schema under a dummy / internal URI (fixes #376) In order to resolve internal $ref references within a user-provided schema, SchemaStorage needs to know about the schema. As user-supplied schemas do not have an associated URI, use a dummy / internal one instead. * Remove dangling use * Change URI to class constant on SchemaStorage * Add option to disable validation of "format" constraint (#383) * Add more unit tests (#366) * Add test coverage for coercion API * Complete test coverage for SchemaStorage * Add test coverage for ObjectIterator * Add exception test for JsonPointer * MabeEnum\Enum appears to use singletons - add testing const * Don't check this line for coverage mbstring is on all test platforms, so this line will never be reached. * Add test for TypeConstraint::validateTypeNameWording() * Add test for exception on TypeConstraint::validateType() * PHPunit doesn't like an explanation with its @codeCoverageIgnore... * Add various tests for UriRetriever * Add tests for FileGetContents * Add tests for JsonSchema\Uri\Retrievers\Curl * Add missing bad-syntax test file * Restrict ignore to the exception line only * Fix exception scope * Allow the schema to be an associative array (#389) * Allow the schema to be an associative array Implements #388. * Use json_decode(json_encode()) for array -> object cast * Skip exception check on PHP versions < 5.5.0 * Skip test on HHVM, as it's happy to encode resources * Enable FILTER_FLAG_EMAIL_UNICODE for email format if present (#398) * Don't throw exceptions until after checking anyOf / oneOf (#394) Fixes #393 * Fix infinite recursion on some schemas when setting defaults (#359) (#365) * Don't try to fetch files that don't exist Throws an exception when the ref can't be resolved to a useful file URI, rather than waiting for something further down the line to fail after the fact. * Refactor defaults code to use LooseTypeCheck where appropriate * Test for not treating non-containers like arrays * Update comments * Rename variable for clarity * Add CHECK_MODE_ONLY_REQUIRED_DEFAULTS If CHECK_MODE_ONLY_REQUIRED_DEFAULTS is set, then only apply defaults if they are marked as required. * Workaround for $this scope issue on PHP-5.3 * Fix infinite recursion via $ref when applying defaults * Add missing second test for array case * Add test for setting a default value for null * Also fix infinite recursion via $ref for array defaults * Move nested closure into separate method * $parentSchema will always be set when $name is, so don't check it * Handle nulls properly - fixes issue #377 * Add option to also validate the schema (#357) * Remove stale files from #357 (obviated by #362) (#400) * Stop #386 sneaking in alongside another PR backport
- Loading branch information
1 parent
ef3ee83
commit e3c9bcc
Showing
68 changed files
with
1,742 additions
and
601 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-03/schema#", | ||
"id": "http://json-schema.org/draft-03/schema#", | ||
"type": "object", | ||
|
||
"properties": { | ||
"type": { | ||
"type": [ "string", "array" ], | ||
"items": { | ||
"type": [ "string", { "$ref": "#" } ] | ||
}, | ||
"uniqueItems": true, | ||
"default": "any" | ||
}, | ||
|
||
"properties": { | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
|
||
"patternProperties": { | ||
"type": "object", | ||
"additionalProperties": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
|
||
"additionalProperties": { | ||
"type": [ { "$ref": "#" }, "boolean" ], | ||
"default": {} | ||
}, | ||
|
||
"items": { | ||
"type": [ { "$ref": "#" }, "array" ], | ||
"items": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
|
||
"additionalItems": { | ||
"type": [ { "$ref": "#" }, "boolean" ], | ||
"default": {} | ||
}, | ||
|
||
"required": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
|
||
"dependencies": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": [ "string", "array", { "$ref": "#" } ], | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"default": {} | ||
}, | ||
|
||
"minimum": { | ||
"type": "number" | ||
}, | ||
|
||
"maximum": { | ||
"type": "number" | ||
}, | ||
|
||
"exclusiveMinimum": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
|
||
"exclusiveMaximum": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
|
||
"minItems": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"default": 0 | ||
}, | ||
|
||
"maxItems": { | ||
"type": "integer", | ||
"minimum": 0 | ||
}, | ||
|
||
"uniqueItems": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
|
||
"pattern": { | ||
"type": "string", | ||
"format": "regex" | ||
}, | ||
|
||
"minLength": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"default": 0 | ||
}, | ||
|
||
"maxLength": { | ||
"type": "integer" | ||
}, | ||
|
||
"enum": { | ||
"type": "array", | ||
"minItems": 1, | ||
"uniqueItems": true | ||
}, | ||
|
||
"default": { | ||
"type": "any" | ||
}, | ||
|
||
"title": { | ||
"type": "string" | ||
}, | ||
|
||
"description": { | ||
"type": "string" | ||
}, | ||
|
||
"format": { | ||
"type": "string" | ||
}, | ||
|
||
"divisibleBy": { | ||
"type": "number", | ||
"minimum": 0, | ||
"exclusiveMinimum": true, | ||
"default": 1 | ||
}, | ||
|
||
"disallow": { | ||
"type": [ "string", "array" ], | ||
"items": { | ||
"type": [ "string", { "$ref": "#" } ] | ||
}, | ||
"uniqueItems": true | ||
}, | ||
|
||
"extends": { | ||
"type": [ { "$ref": "#" }, "array" ], | ||
"items": { "$ref": "#" }, | ||
"default": {} | ||
}, | ||
|
||
"id": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
|
||
"$ref": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
|
||
"$schema": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
}, | ||
|
||
"dependencies": { | ||
"exclusiveMinimum": "minimum", | ||
"exclusiveMaximum": "maximum" | ||
}, | ||
|
||
"default": {} | ||
} |
Oops, something went wrong.