Skip to content

Commit a713a22

Browse files
committed
Skip unknown properties in ownerSchema
1 parent 0534bbb commit a713a22

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/JsonSchema/SchemaBuilder.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,9 @@ private function copyTo(SchemaBuilder $schemaBuilder)
311311

312312
private function processOther()
313313
{
314-
static $skip = null;
314+
static $skip = null, $emptySchema = null;
315315
if ($skip === null) {
316+
$emptySchema = new Schema();
316317
$names = Schema::names();
317318
$skip = array(
318319
$names->type => 1,
@@ -344,6 +345,10 @@ private function processOther()
344345
continue;
345346
}
346347

348+
if (!property_exists($emptySchema, $key) && $key !== 'const' && $key[0] !== '$') {
349+
continue;
350+
}
351+
347352
//$this->result->addSnippet('/* ' . print_r($value, 1) . '*/' . "\n");
348353
//echo "{$this->varName}->{$key}\n";
349354
if ($value instanceof ObjectItem) {

0 commit comments

Comments
 (0)