Skip to content

Commit e66e4c3

Browse files
Merge pull request #125 from martin-helmich/fix/deprecated-in-allof
fix: handle deprecated properties in allOf schemas
2 parents b3fa512 + 08e4f37 commit e66e4c3

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Generator/PropertyQuery.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ class PropertyQuery
88
public static function isDeprecated(PropertyInterface $property): bool
99
{
1010
$schema = $property->schema();
11-
return isset($schema["deprecated"]) && $schema["deprecated"];
11+
if (isset($schema["deprecated"]) && $schema["deprecated"]) {
12+
return true;
13+
}
14+
15+
if (isset($schema["allOf"])) {
16+
foreach ($schema["allOf"] as $subSchema) {
17+
if (isset($subSchema["deprecated"]) && $subSchema["deprecated"]) {
18+
return true;
19+
}
20+
}
21+
}
22+
23+
return false;
1224
}
1325
}

0 commit comments

Comments
 (0)