Skip to content

Commit 3db4ca8

Browse files
authored
Update RefResolver.php
Address P1 Issue and improve error messaging when nesting level exceeded.
1 parent ef31f48 commit 3db4ca8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/RefResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ public function resolveReference($referencePath)
226226
*/
227227
public function preProcessReferences($data, Context $options, $nestingLevel = 0)
228228
{
229-
if ($nestingLevel > $this->max_deep_nesting) { //Updated due to specific recursion depth from Amazon product JSON Schemas - yep 200 was not enough
230-
throw new Exception('Too deep nesting level. Suggest submitting maxNestLevel via options', Exception::DEEP_NESTING);
229+
if ($nestingLevel > $this->maxNestLevel) { //Updated due to specific recursion depth from Amazon product JSON Schemas - yep 200 was not enough
230+
throw new Exception('Too deep nesting level. Nesting / Recursion level (' . $nestingLevel . ') exceeds ' . $this->maxNestLevel , Exception::DEEP_NESTING);
231231
}
232232
if (is_array($data)) {
233233
foreach ($data as $key => $item) {

0 commit comments

Comments
 (0)