Skip to content

Commit

Permalink
Implement feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SOHELAHMED7 committed Dec 11, 2024
1 parent dff8a03 commit c1402a9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/openapi/PropertySchema.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,15 @@ public function isRefPointerToSchema():bool

public function isRefPointerToSelf():bool
{
$schema = Json::decode(Json::encode($this->schema->getSchema()->getSerializableData()));
$allOfsInSchema = null;
if (isset($this->schema->getSchema()->properties[$this->name]->allOf)) {
$allOfsInSchema = $this->schema->getSchema()->properties[$this->name]->allOf;
}

if (isset($schema['properties'][$this->name]['allOf'])) { # fixes https://github.com/php-openapi/yii2-openapi/issues/68
$allOfs = $schema['properties'][$this->name]['allOf'];
if ($allOfsInSchema) { # fixes https://github.com/php-openapi/yii2-openapi/issues/68
$refCounter = 0;
foreach ($allOfs as $allOf) {
if (isset($allOf['$ref'])) {
foreach ($allOfsInSchema as $allOf) {
if ($allOf instanceof Reference) {
$refCounter++;
}
}
Expand Down

0 comments on commit c1402a9

Please sign in to comment.