Skip to content

Commit

Permalink
Don't warn when we deal with binary return types
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Dec 7, 2023
1 parent a7eb954 commit 113bf16
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions generate-spec
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ foreach ($scopePaths as $scope => $paths) {
foreach ($routeData['responses'] as $statusCode => $responseData) {
if (isset($responseData['content']['application/json'])) {
$usedSchemas = array_merge($usedSchemas, Helpers::collectUsedRefs($responseData['content']['application/json']['schema']));
} elseif (isset($responseData['content']['*/*']['schema']['type'], $responseData['content']['*/*']['schema']['format'])
&& $responseData['content']['*/*']['schema']['type'] === 'string'
&& $responseData['content']['*/*']['schema']['format'] === 'binary') {
Logger::info("app", "Binary response from '$httpMethod $url' - Skipping schema reading");
} else {
Logger::warning("app", "Could not read used schemas for response to '$httpMethod $url' with status code $statusCode");
}
Expand Down

0 comments on commit 113bf16

Please sign in to comment.