Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't break on files responses
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Nov 10, 2023
commit 0358899eb9c27adb479fef9b8b95bc4f0091db2a
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