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

Change to allow MaxDepth to be set on construct of the RefResolver #179

Closed
wants to merge 2 commits into from

Conversation

s3than
Copy link

@s3than s3than commented Jul 27, 2015

If required for complex schemas the ability to set the max depth on construct of the RefResolver

No B/C break.

@s3than
Copy link
Author

s3than commented Jul 27, 2015

It looks like Travis timed out the composer update. Can you confirm or re-run. Thanks

@bighappyface
Copy link
Collaborator

@s3than thanks for the help.

Would you please expand on the current test for this, or create another for testing the maximum depth?

https://github.com/justinrainbow/json-schema/blob/34ca930d9fbfb439ae8d3b87ca046b914e190295/tests/JsonSchema/Tests/RefResolverTest.php

@GavinCS
Copy link

GavinCS commented Jul 30, 2015

this fix doesn't fix the underlying problem faced with recursive referencing as in issue #180.
I ended up with the following fatal exception:
Fatal error: Maximum function nesting level of '250' reached, aborting! in .../vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php on line 160

@GrahamCampbell
Copy link
Contributor

Your nesting limit is probably still too low then.

@GavinCS
Copy link

GavinCS commented Jul 30, 2015

Thanks. After further investigation I found that this exception is being thrown by the nesting level set in xdebug.

However no matter how high I set the maximum depth, recursion seems to be causing an infinite loop.
This is not the case when reverting to 1.4.3 pre maximum depth

@bighappyface
Copy link
Collaborator

@GavinCS would you add a test or post a JSON document showcasing the issues you are encountering?

Regarding 1.4.3, the exception was added in 1.4.4 in place of a hard return. In 1.4.3, the validator isn't considering the nested schemas at all past the maximum depth, so I am not sure that 1.4.3 was actually working as much as just not throwing the exception.

@bighappyface
Copy link
Collaborator

Closed with #174

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.

4 participants