Skip to content

Commit beb51c5

Browse files
committed
Added guards for cloud plugins
1 parent ad0b9d8 commit beb51c5

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

Annotations/AnnotationGenerator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public function __construct(DocumentationGenerator $generator)
105105
public function generatePluginApiAnnotations(string $pluginName, bool $writeToFile = false): array
106106
{
107107
BaseValidator::check('plugin', $pluginName, [new NotEmpty()]);
108+
109+
if (in_array($pluginName, ['Billing', 'Cloud', 'ConnectAccounts'], true)) {
110+
throw new \RuntimeException('OpenAPI doc generation is blocked for ' . $pluginName . '.');
111+
}
112+
108113
if (!Manager::getInstance()->isPluginInFilesystem($pluginName)) {
109114
throw new PluginNotFoundException($pluginName);
110115
}

Specs/SpecGenerator.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ public function generatePluginDoc(string $pluginName, string $format = 'json', s
4646
{
4747
BaseValidator::check('plugin', $pluginName, [new NotEmpty()]);
4848

49+
foreach (explode(',', $pluginName) as $currentPluginName) {
50+
if (in_array($currentPluginName, ['Billing', 'Cloud', 'ConnectAccounts'], true)) {
51+
throw new \RuntimeException('OpenAPI doc generation is blocked for ' . $currentPluginName . '.');
52+
}
53+
}
54+
4955
return $this->generateSpec(explode(',', $pluginName), $format, $version, $writeToFile);
5056
}
5157

0 commit comments

Comments
 (0)