Skip to content

Commit

Permalink
fix: Undefined array key "properties" (#951)
Browse files Browse the repository at this point in the history
  • Loading branch information
SRWieZ authored Feb 20, 2025
1 parent c5e5677 commit eb08910
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Writing/OpenApiSpecGenerators/BaseGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -549,11 +549,12 @@ public function generateSchemaForResponseValue(mixed $value, OutputEndpointData
$schema['items']['properties'] = collect($sample)->mapWithKeys(function ($v, $k) use ($endpoint, $path) {
return [$k => $this->generateSchemaForResponseValue($v, $endpoint, "$path.$k")];
})->toArray();
}

$required = $this->filterRequiredResponseFields($endpoint, array_keys($schema['items']['properties']), $path);
if ($required) {
$schema['required'] = $required;

$required = $this->filterRequiredResponseFields($endpoint, array_keys($schema['items']['properties']),
$path);
if ($required) {
$schema['required'] = $required;
}
}
}

Expand Down

0 comments on commit eb08910

Please sign in to comment.