Skip to content

Commit

Permalink
Make schema lookup work for custom schema implementations (#1403)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerManoMann authored Feb 3, 2023
1 parent 3700114 commit e449670
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Analysis.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
namespace OpenApi;

use OpenApi\Annotations as OA;
use OpenApi\Attributes as OAT;
use OpenApi\Processors\ProcessorInterface;

/**
Expand Down Expand Up @@ -339,7 +338,7 @@ public function getSchemaForSource(string $fqdn): ?OA\Schema
$definition = $definitions[$fqdn];
if (is_iterable($definition['context']->annotations)) {
foreach (array_reverse($definition['context']->annotations) as $annotation) {
if (in_array(get_class($annotation), [OA\Schema::class, OAT\Schema::class]) && !$annotation->_context->is('generated')) {
if ($annotation->isRoot(OA\Schema::class) && !$annotation->_context->is('generated')) {
return $annotation;
}
}
Expand Down

0 comments on commit e449670

Please sign in to comment.