Skip to content

Commit 0358899

Browse files
committed
Don't break on files responses
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 23ca851 commit 0358899

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

generate-spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,11 @@ foreach ($scopePaths as $scope => $paths) {
735735
foreach ($paths as $url => $urlRoutes) {
736736
foreach ($urlRoutes as $httpMethod => $routeData) {
737737
foreach ($routeData['responses'] as $statusCode => $responseData) {
738-
$usedSchemas = array_merge($usedSchemas, Helpers::collectUsedRefs($responseData['content']['application/json']['schema']));
738+
if (isset($responseData['content']['application/json'])) {
739+
$usedSchemas = array_merge($usedSchemas, Helpers::collectUsedRefs($responseData['content']['application/json']['schema']));
740+
} else {
741+
Logger::warning("app", "Could not read used schemas for response to '$httpMethod $url' with status code $statusCode");
742+
}
739743
}
740744
}
741745
}

0 commit comments

Comments
 (0)