You are here

protected function JsonApiGenerator::getEntityDefinitionKey in OpenAPI 8

Gets the entity definition key.

Parameters

string $entity_type_id: The entity type.

string $bundle_name: The bundle name.

Return value

string The entity definition key. Either [entity_type] or [entity_type]:[bundle_name]

Overrides OpenApiGeneratorBase::getEntityDefinitionKey

2 calls to JsonApiGenerator::getEntityDefinitionKey()
JsonApiGenerator::getDefinitions in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php
Get model definitions for Drupal entities and bundles.
JsonApiGenerator::getEntityResponsesJsonApi in src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php

File

src/Plugin/openapi/OpenApiGenerator/JsonApiGenerator.php, line 853

Class

JsonApiGenerator
Defines an OpenApi Schema Generator for the JsonApi module.

Namespace

Drupal\openapi\Plugin\openapi\OpenApiGenerator

Code

protected function getEntityDefinitionKey($entity_type_id, $bundle_name = NULL) {

  // Override the default definition key structure to use 'type--bundle'.
  if (!$bundle_name) {
    $bundle_name = $entity_type_id;
  }
  return parent::getEntityDefinitionKey($entity_type_id, $bundle_name);
}