diff --git a/generate-spec b/generate-spec index e2ca2c8..0e3253c 100755 --- a/generate-spec +++ b/generate-spec @@ -817,26 +817,10 @@ foreach ($scopePaths as $scope => $paths) { Logger::error("app", "Schema $schemaName used by scope $scope is not defined"); } - // Queue potential sub-refs for exporting as well - foreach (['allOf', 'oneOf', 'anyOf', 'properties', 'additionalProperties'] as $group) { - if (isset($schemas[$schemaName][$group])) { - foreach ($schemas[$schemaName][$group] as $subType) { - $newRefs = Helpers::collectUsedRefs($subType); - foreach ($newRefs as $newRef) { - if (!isset($scopedSchemas[substr($newRef, strlen('#/components/schemas/'))])) { - $usedSchemas[] = $newRef; - } - } - } - } - } - - if (isset($schemas[$schemaName]['items'])) { - $newRefs = Helpers::collectUsedRefs($schemas[$schemaName]['items']); - foreach ($newRefs as $newRef) { - if (!isset($scopedSchemas[substr($newRef, strlen('#/components/schemas/'))])) { - $usedSchemas[] = $newRef; - } + $newRefs = Helpers::collectUsedRefs($schemas[$schemaName]); + foreach ($newRefs as $newRef) { + if (!isset($scopedSchemas[substr($newRef, strlen('#/components/schemas/'))])) { + $usedSchemas[] = $newRef; } }