Skip to content

Commit

Permalink
fix(example): fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
sidux committed Feb 19, 2024
1 parent 08a0ad5 commit 87e7bca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Definition/Loader/OpenApiDefinitionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ private function extractDeepExamples(Schema $schema, bool $optional = false): ar
$parent[$name] = null;
} elseif (!$optional && \in_array($name, $schema->required ?? [], true)) {
$fakeSchema = (new SchemaFaker($schema, new Options()))->generate();
$parent[$name] = $fakeSchema[$name];
if (is_array($fakeSchema) && isset($fakeSchema[$name])) {
$parent[$name] = $fakeSchema[$name];
}
}
}
}
Expand Down

0 comments on commit 87e7bca

Please sign in to comment.