Skip to content

Commit

Permalink
Don't break on files responses
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Nov 10, 2023
1 parent 23ca851 commit 0358899
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,11 @@ foreach ($scopePaths as $scope => $paths) {
foreach ($paths as $url => $urlRoutes) {
foreach ($urlRoutes as $httpMethod => $routeData) {
foreach ($routeData['responses'] as $statusCode => $responseData) {
$usedSchemas = array_merge($usedSchemas, Helpers::collectUsedRefs($responseData['content']['application/json']['schema']));
if (isset($responseData['content']['application/json'])) {
$usedSchemas = array_merge($usedSchemas, Helpers::collectUsedRefs($responseData['content']['application/json']['schema']));
} else {
Logger::warning("app", "Could not read used schemas for response to '$httpMethod $url' with status code $statusCode");
}
}
}
}
Expand Down

0 comments on commit 0358899

Please sign in to comment.