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

Infinite loop when I check JSON schema file #185

Closed
mrix opened this issue Aug 26, 2015 · 2 comments
Closed

Infinite loop when I check JSON schema file #185

mrix opened this issue Aug 26, 2015 · 2 comments

Comments

@mrix
Copy link
Contributor

mrix commented Aug 26, 2015

I want to validate my JSON schema file

$refResolver = new \JsonSchema\RefResolver();
$refResolver::$maxDepth = 10000;

$jsonSchema = $refResolver->getUriRetriever()->retrieve('http://json-schema.org/draft-04/schema#');
$refResolver->resolve($jsonSchema);

Script failed with error:

PHP Fatal error:  Uncaught exception 'JsonSchema\Exception\JsonDecodingException' with message 'The maximum stack depth has been exceeded' in /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php:100
Stack trace:
#0 /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php(63): JsonSchema\RefResolver->resolve(Object(stdClass))
#1 /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php(208): JsonSchema\RefResolver->fetchRef('#', 'http://json-sch...')
#2 /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php(114): JsonSchema\RefResolver->resolveRef(Object(stdClass), 'http://json-sch...')
#3 /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php(152): JsonSchema\RefResolver->resolve(Object(stdClass), 'http://json-sch...')
#4 /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php(126): JsonSchema\RefResolver->resolveArray in /sync/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php on line 100
@jojo1981
Copy link

Should also be fixed after merging: #245

@bighappyface
Copy link
Collaborator

Closed with #245

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

No branches or pull requests

3 participants