You are here

protected function OpenApiGeneratorManager::findDefinitions in OpenAPI 8

Finds plugin definitions.

Return value

array List of definitions to store in cache.

Overrides DefaultPluginManager::findDefinitions

File

src/Plugin/openapi/OpenApiGeneratorManager.php, line 42

Class

OpenApiGeneratorManager
Defines interface for OpenApiGeneratorManager.

Namespace

Drupal\openapi\Plugin\openapi

Code

protected function findDefinitions() {
  $definitions = parent::findDefinitions();
  foreach ([
    'jsonapi',
    'rest',
  ] as $api_module) {
    if (isset($definitions[$api_module]) && !$this->moduleHandler
      ->moduleExists($api_module)) {
      unset($definitions[$api_module]);
    }
  }
  return $definitions;
}