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

Backports for 5.2.0 #368

Merged
merged 13 commits into from
Mar 22, 2017
Merged

Backports for 5.2.0 #368

merged 13 commits into from
Mar 22, 2017

Conversation

erayd
Copy link
Contributor

@erayd erayd commented Mar 7, 2017

Various stuff from 6.0.0 that can be backported to 5.2.0 without breaking backwards-compatibility. Will add new stuff where possible as it's merged.

Backported PRs

Skipped PRs

@bighappyface
Copy link
Collaborator

bighappyface commented Mar 17, 2017

Any more items to add here?

5.3.0? Nevermind me...

@erayd
Copy link
Contributor Author

erayd commented Mar 17, 2017

@bighappyface You're welcome to merge backport PRs whenever suits - I'll just open another one with a higher version number each time you do. And if you want me to stop adding things to a particular backport PR, just let me know. That way you can decide when you want backport releases to happen, and what you want in them :-).

Looks like I'll have a bit of backporting work to do this weekend though, you've merged a ton of stuff to 6.0.0! 👍

@erayd
Copy link
Contributor Author

erayd commented Mar 17, 2017

Also thanks for all the merging :-).

@bighappyface
Copy link
Collaborator

Thanks for your patience and continued work. I know I go silent for weeks at a time, but I am still here.

@erayd @shmax @mathroc you are all steely-eyed missile men 🚀

erayd and others added 5 commits March 17, 2017 18:42
…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 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
@erayd
Copy link
Contributor Author

erayd commented Mar 17, 2017

This PR is now up-to-date with what has been merged to 6.0.0-dev.

@erayd
Copy link
Contributor Author

erayd commented Mar 17, 2017

@bighappyface I notice you've added this to merged / closed for 5.2.0, but it's not merged or closed. Were you intending this to go in one of the other sections, or are you intending to merge this now?

@bighappyface
Copy link
Collaborator

@erayd @shmax the various PRs for 6.0.0 are either merged or pending merge after being rebased.

Once they are merged I would like to provide time for backport to 5.x in the master branch, then I will rebase, then we can look at merging 6.0.0.

Does that sound okay?

@erayd
Copy link
Contributor Author

erayd commented Mar 21, 2017

Works for me :-)

@erayd
Copy link
Contributor Author

erayd commented Mar 21, 2017

Although I do think we need to work on #392 before there is an actual tagged 6.0.0 release.

@bighappyface
Copy link
Collaborator

Anything else going in this? I am ready to go on this so that we can focus on 6.0.0 moving forward.

@erayd
Copy link
Contributor Author

erayd commented Mar 21, 2017

I'm going through the stuff you just merged - I think at least the recursion fix needs to be in this.

* 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
@erayd
Copy link
Contributor Author

erayd commented Mar 21, 2017

OK, I think that's everything :-).

@erayd
Copy link
Contributor Author

erayd commented Mar 21, 2017

Have updated the PR description with everything that's in this, and everything that's been skipped.

Copy link
Collaborator

@bighappyface bighappyface left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@bighappyface bighappyface merged commit e3c9bcc into jsonrainbow:master Mar 22, 2017
@erayd erayd deleted the backport-520 branch March 23, 2017 01:02
@erayd erayd mentioned this pull request May 30, 2020
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.

3 participants