Skip to content
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
wants to merge 88 commits into from
Closed

Conversation

aboyton
Copy link

@aboyton aboyton commented May 23, 2018

erayd and others added 30 commits March 7, 2017 09:20
…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
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.
bighappyface and others added 27 commits December 30, 2017 23:13
Fix: Consistently indent with 2 spaces
Enhancement: Implicitly enable no_unused_imports fixer
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.
Remove large array type-specific performance optimisation
…rror-message

Don't cast multipleOf to be an integer for the error message
@bighappyface bighappyface changed the base branch from master to 5.x.x October 19, 2018 17:38
@bighappyface
Copy link
Collaborator

@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.