You are here

interface OpenApiGeneratorInterface in OpenAPI 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/openapi/OpenApiGeneratorInterface.php \Drupal\openapi\Plugin\openapi\OpenApiGeneratorInterface

Defines OpenApiGeneratorInterface for OpenApi Generator Plugins.

Hierarchy

Expanded class hierarchy of OpenApiGeneratorInterface

All classes that implement OpenApiGeneratorInterface

2 files declare their use of OpenApiGeneratorInterface
ApiSpecificationController.php in src/Controller/ApiSpecificationController.php
OpenApiUiController.php in src/Controller/OpenApiUiController.php

File

src/Plugin/openapi/OpenApiGeneratorInterface.php, line 8

Namespace

Drupal\openapi\Plugin\openapi
View source
interface OpenApiGeneratorInterface {

  /**
   * Set the options for the current schema download.
   *
   * @todo Document all options.
   *
   * @param array $options
   *   The options for the specification generation.
   *   - exclude: Array of Entity types or bundles to exclude in the format,
   *      "[ENTITY_TYPE]" or "[ENTITY_TYPE]:[BUNDLE]".
   */
  public function setOptions($options);

  /**
   * Get the options for the current schema download.
   *
   * @return array
   *   The options for generating the schema.
   */
  public function getOptions();

  /**
   * Get plugin id.
   *
   * @return string
   *   Plugin id.
   */
  public function getId();

  /**
   * Get plugin label.
   *
   * @return string
   *   Plugin label.
   */
  public function getLabel();

  /**
   * Get base path for schema.
   *
   * @return string
   *   String name with a leading slash.
   */
  public function getBasePath();

  /**
   * Returns a list of valid security types for the api.
   *
   * Values of returned array will be empty, except for OAuth2 definitions, for
   * which the required scopes should be returned.
   *
   * @return array
   *   An array where keys correspond to a security scheme.
   */
  public function getSecurity();

  /**
   * Get a list a valid security method definitions.
   *
   * Returned schema should be similar to the below structure.
   *
   * ```
   * {
   *   "api_key": {
   *     "type": "apiKey",
   *     "name": "api_key",
   *     "in": "header"
   *   },
   *   "petstore_auth": {
   *     "type": "oauth2",
   *     "authorizationUrl": "http://swagger.io/api/oauth/dialog",
   *     "flow": "implicit",
   *     "scopes": {
   *       "write:pets": "modify pets in your account",
   *       "read:pets": "read your pets"
   *     }
   *   }
   * }
   * ```
   *
   * @return array
   *   Associative array of security definitions.
   */
  public function getSecurityDefinitions();

  /**
   * Get tags for schema.
   *
   * @return array
   *   Schema tag list.
   */
  public function getTags();

  /**
   * Returns the paths information.
   *
   * @return array
   *   The info elements.
   */
  public function getPaths();

  /**
   * Generates OpenAPI specification.
   *
   * @return array
   *   The specification output.
   */
  public function getSpecification();

  /**
   * Get model definitions for Drupal entities and bundles.
   *
   * @return array
   *   The model definitions.
   */
  public function getDefinitions();

  /**
   * Get a list of all MIME Type that the API Consumes
   *
   * @return array
   *    An array of all MIME Type that the API Consumes
   */
  public function getConsumes();

  /**
   * Get a list of all MIME Type that the API Produces
   *
   * @return array
   *    An array of all MIME Type that the API Produces
   */
  public function getProduces();

}

Members

Namesort descending Modifiers Type Description Overrides
OpenApiGeneratorInterface::getBasePath public function Get base path for schema. 1
OpenApiGeneratorInterface::getConsumes public function Get a list of all MIME Type that the API Consumes 1
OpenApiGeneratorInterface::getDefinitions public function Get model definitions for Drupal entities and bundles. 1
OpenApiGeneratorInterface::getId public function Get plugin id. 1
OpenApiGeneratorInterface::getLabel public function Get plugin label. 1
OpenApiGeneratorInterface::getOptions public function Get the options for the current schema download. 1
OpenApiGeneratorInterface::getPaths public function Returns the paths information. 1
OpenApiGeneratorInterface::getProduces public function Get a list of all MIME Type that the API Produces 1
OpenApiGeneratorInterface::getSecurity public function Returns a list of valid security types for the api. 1
OpenApiGeneratorInterface::getSecurityDefinitions public function Get a list a valid security method definitions. 1
OpenApiGeneratorInterface::getSpecification public function Generates OpenAPI specification. 1
OpenApiGeneratorInterface::getTags public function Get tags for schema. 1
OpenApiGeneratorInterface::setOptions public function Set the options for the current schema download. 1