Skip to content

Commit 5b78fcc

Browse files
authored
Update Schema.php
Address P1 Issue and set default for max level to constant DEFAULT_MAX_NEST
1 parent 3db4ca8 commit 5b78fcc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Schema.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class Schema extends JsonSchema implements MetaHolder, SchemaContract, HasDefaul
3737
const CONST_PROPERTY = 'const';
3838
const DEFAULT_PROPERTY = 'default';
3939

40+
const DEFAULT_MAX_NEST = 200;
41+
4042
const DEFAULT_MAPPING = 'default';
4143

4244
const VERSION_AUTO = 'a';
@@ -165,7 +167,7 @@ public function in($data, ?Context $options = null)
165167
$options->import = true;
166168

167169
if ($options->refResolver === null) {
168-
$options->refResolver = new RefResolver($data, $options->maxNestLevel ?? 200);
170+
$options->refResolver = new RefResolver($data, $options->maxNestLevel ?? DEFAULT_MAX_NEST);
169171
} else {
170172
$options->refResolver->setRootData($data);
171173
}

0 commit comments

Comments
 (0)