Skip to content

Commit

Permalink
Check on body class for properties valid for iteration on allOF
Browse files Browse the repository at this point in the history
  • Loading branch information
adevita committed Feb 4, 2022
1 parent fbfc5ec commit 3243599
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Base/Body.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,13 @@ protected function matchSchema($name, $schemaArray, $body)
if (isset($schema['$ref'])) {
$schema = $this->schema->getDefinition($schema['$ref']);
foreach ($schema as $type => $properties) {
foreach ($properties as $item) {
if (isset($item['$ref'])) {
$schema2 = $this->schema->getDefinition($item['$ref']);
$schema = array_merge_recursive($schema[$type][0],
$schema2);
if ($type == 'allOf') {
foreach ($properties as $item) {
if (isset($item['$ref'])) {
$schema2 = $this->schema->getDefinition($item['$ref']);
$schema = array_merge_recursive($schema[$type][0],
$schema2);
}
}
}
}
Expand Down

0 comments on commit 3243599

Please sign in to comment.