You are here

protected function OpenApiGeneratorBase::getDefinitionReference in OpenAPI 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/openapi/OpenApiGeneratorBase.php \Drupal\openapi\Plugin\openapi\OpenApiGeneratorBase::getDefinitionReference()

Gets the reference to the definition in the document.

Parameters

string $entity_type_id: The entity type id.

string $bundle_name: The bundle name.

Return value

string The reference to the definition.

4 calls to OpenApiGeneratorBase::getDefinitionReference()
JsonApiGenerator::getEntityResponsesJsonApi in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
JsonApiGenerator::getMethodParameters in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
Get the parameters array for a method on a route.
JsonApiGenerator::getTags in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
Get tags for schema.
OpenApiGeneratorBase::getEntityResponses in src/Plugin/openapi/OpenApiGeneratorBase.php
Get possible responses for an entity type.

File

src/Plugin/openapi/OpenApiGeneratorBase.php, line 515

Class

OpenApiGeneratorBase
Defines base class for OpenApi Generator plugins.

Namespace

Drupal\openapi\Plugin\openapi

Code

protected function getDefinitionReference($entity_type_id, $bundle_name = NULL) {
  $definition_key = $this
    ->getEntityDefinitionKey($entity_type_id, $bundle_name);
  if ($this
    ->definitionExists($definition_key)) {
    $definition_ref = '#/definitions/' . $definition_key;
    return $definition_ref;
  }
  return '';
}