Skip to content

Resolve backport conflicts #402

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

Closed
wants to merge 19 commits into from

Conversation

erayd
Copy link
Contributor

@erayd erayd commented Mar 22, 2017

What

Why

Because @bighappyface asked me to solve the merge conflict in 6.0.0-dev, I'm assuming because he doesn't want it directly rebased on ef3ee83 (to avoid orphaning 5.2.0).

erayd and others added 19 commits March 23, 2017 12:10
…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
@erayd
Copy link
Contributor Author

erayd commented Mar 22, 2017

Before you merge - do you want me to turn this into a single commit that resolves the conflict, or would you like to keep it as-is? If the latter, then you may want to do this as a straight merge, and not a squash merge, to avoid losing the 6.0.0-dev commit history.

@erayd erayd mentioned this pull request Mar 22, 2017
@erayd
Copy link
Contributor Author

erayd commented Mar 22, 2017

Thought of a saner method.

@erayd erayd closed this Mar 22, 2017
@erayd erayd deleted the resolve-backport-conflicts branch March 22, 2017 23:40
@erayd erayd restored the resolve-backport-conflicts branch March 22, 2017 23:59
@erayd erayd deleted the resolve-backport-conflicts branch March 23, 2017 03:08
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.

2 participants