Skip to content

Commit

Permalink
Fixes #173
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil committed Nov 30, 2019
1 parent 1927451 commit 89d351b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/OpenApi/Guesser/OpenApiSchema/OpenApiGuesser.php
Expand Up @@ -103,13 +103,13 @@ protected function getClassFromOperation($name, ?Operation $operation, $referenc
}
}

if ($operation->getRequestBody() && $operation->getRequestBody()->getContent()) {
if (null !== $operation->getRequestBody() && is_iterable($operation->getRequestBody()->getContent())) {
foreach ($operation->getRequestBody()->getContent() as $contentType => $content) {
$this->chainGuesser->guessClass($content->getSchema(), $name . 'Body', $reference . '/requestBody/content/' . $contentType . '/schema', $registry);
}
}

if ($operation->getResponses()) {
if (is_iterable($operation->getResponses())) {
foreach ($operation->getResponses() as $status => $response) {
if ($response instanceof Response && $response->getContent()) {
foreach ($response->getContent() as $contentType => $content) {
Expand Down

0 comments on commit 89d351b

Please sign in to comment.