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

Exception Error: "Maximum function nesting level of '256' reached, aborting!" #679

Closed
infisamk opened this issue Nov 9, 2021 · 1 comment

Comments

@infisamk
Copy link

infisamk commented Nov 9, 2021

Exception Error: "Maximum function nesting level of '256' reached, aborting!" at /var/www/html/adminpanel/vendor/justinrainbow/json-schema/src/JsonSchema/Entity/JsonPointer.php line 37

Request and schema:
files.zip

Use as:

$validator = new Validator();
$validator->validate($obj, $schema, Constraint::CHECK_MODE_APPLY_DEFAULTS);

I checked request and schema on another library and online validator. They are valid.

@DannyvdSluijs
Copy link
Collaborator

@infisamk I took the files linked above and your reproduction code and changed it every so slightly it works from the root level of this library and I can't reproduce. Is there something I'm missing, or did you find any cause in the schema/request and perhaps updated the files?

The code I'm running on my machine is as below using the b580100 commit which is the latest from master and against 4c74da5 which seemed to be the commit at the day of your report on the master branch.

Perhaps you can take another look and let us know? Also feel free to close the issue altogether if this no longer is something you're pursuing.

<?php

use JsonSchema\Constraints\Constraint;
use JsonSchema\Uri\UriRetriever;
use JsonSchema\Validator;

require_once 'vendor/autoload.php';

$retriever = new UriRetriever();
$schema = $retriever->retrieve('file://' . realpath('./schema.json'));

$obj = json_decode(file_get_contents('request.json'), false);

$validator = new Validator();
$result = $validator->validate($obj, $schema, Constraint::CHECK_MODE_APPLY_DEFAULTS);

echo 'result: ' . $result;

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