-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs about calling reset #516
Closed
Closed
Conversation
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
…nrainbow#362) * Add URI translation for retrieval & add local copies of spec schema * Use dist copies of schemas No need to keep duplicate files around in package://tests/fixtures/ if we're distributing them for users anyway. * Move package:// translation after all other rules Allows users to rewrite to package:// targets and still have the URI work.
* centralize errors * isolate 'more' info * throw exception for missing error message * swap args
This reverts commit 73ef463. 'email' is only a valid type attribute in draft-03 (later versions of the spec explicitly limit the value of type to the core primitive types), and this code doesn't validate email addresses anyway. IMO we should be validating it properly or not at all, and noting this went away after draft-03 my opinion is on the not-at-all side of the fence. Note that 'email' is *never* defined as a spec type, in any version - it just slips in under the radar of the draft-03 language which allows users to put arbitrary things in the type field.
…rainbow#376) (jsonrainbow#378) * Add provided schema under a dummy / internal URI (fixes jsonrainbow#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 quiet option * use verbose instead of quiet * add quiet option * always output dump-schema * always output dump-schema-url * fix typo and ws
* Add test coverage for coercion API * Complete test coverage for SchemaStorage * Add test coverage for ObjectIterator * Add tests for ConstraintError * 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 Implements jsonrainbow#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
…nbow#359) (jsonrainbow#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 jsonrainbow#377
* Improve performance - don't loop over everything if already valid * Don't coerce already-valid types (fixes jsonrainbow#379) * Add remaining coercion cases & rewrite tests * Add all remaining coercion cases from ajv matrix * Rewrite the coercion tests to tidy things up a bit * Add CHECK_MODE_EARLY_COERCE If set, falls back to the old behavior of coercing to the first compatible type, regardless of whether another already-valid type might be available. * Add multiple-type test that requires coercion * \JSON_PRETTY_PRINT doesn't exist in PHP-5.3, so work around this * Various PR cleanup stuff * Fix whitespace * Turn $early into $extraFlags * Change "string" to "ABC" in string test * Update README.md description of CHECK_MODE_EARLY_COERCE * Move loop after complex tests definition * Move test jsonrainbow#39 to grid jsonrainbow#15
This reverts commit e3c9bcc.
Object validation attempts to use a single variable to store both the object definition, and its properties. This causes validation to be incomplete where "properties" is not set, but "additionalProperties" is. This commit fixes both bugs in issue jsonrainbow#353.
* Cast root to object * Use function_exists to allow polyfill compatibility * Move array->object conversion to SchemaConstraint & SchemaStorage Fixes issue jsonrainbow#408
…jsonrainbow#405) all items and add support for minItems when applying defaults
…onrainbow#401) * Fix autoload to work properly with composer dependencies * Use dirname()
…hema bug (jsonrainbow#419) * Split "uri" format into "uri" and "uri-reference" * Correct format for id & $ref in draft-03/04 meta-schemas See json-schema-org/JSON-Schema-Test-Suite#177 (comment)
…nbow#429) * Remove dev-time dependency on phpdocumentor due to resolution headaches * Switch distro for hhvm testing to trusty (precise now unsupported)
Note that this bugfix will cause empty query strings to be dropped (e.g. http://example.com?#blue becomes http://example.com#blue). This is because the '?' character is deliberately not captured as part of the query string, and the testsuite expects to be able to pass an empty query string and *not* have the '?' added for that case.
Fix: Consistently indent with 2 spaces
Fix: Add PHP 7.2 to build matrix
Fix: No need to update composer itself
Enhancement: Implicitly enable no_unused_imports fixer
Fix: Remove unused argument
Fix: Keep rules sorted in .php_cs.dist
Fix: Mark check() and coerce() as deprecated
Note that siblings of $ref are ignored, per the spec.
[BUGFIX] Apply defaults in $ref'ed property / item definitions
Fixes jsonrainbow#441. The bug in jsonrainbow#441 was caused by refactoring of the optimisation which introduced a type-checking error. Noting the performance impact is negligible for all cases other than large arrays of strings or numbers, and introduces significant cognitive complexity to a project that is extremely short of maintainers, removing it seems like the best course of action. The performance improvement provided by this optimisation was approximately 40%, however it also carried a number of other problematic bugs - if it were to be reintroduced at a later date with those bugs fixed (mainly the skipping of much of the validation logic for optimised items, even in cases where that logic might be necessary), it would not have such a significant impact.
Enhancement: Normalize composer.json
Remove large array type-specific performance optimisation
…rror-message Don't cast multipleOf to be an integer for the error message
…support Add support for "const"
@aboyton I presume the doc update would be against the 5.x.x branch? I have changed the base of this PR and things got crazy. It may be easier to open another PR, so I am going to close this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref /issues/385