diff --git a/generate-spec b/generate-spec index 1e89404..d5359fb 100755 --- a/generate-spec +++ b/generate-spec @@ -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"); + } } } }