Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save superbiche/7cbf2f24c395892577971ec904496709 to your computer and use it in GitHub Desktop.
Save superbiche/7cbf2f24c395892577971ec904496709 to your computer and use it in GitHub Desktop.
diff --git a/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php b/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
index d1a8553..a953bdf 100644
--- a/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
+++ b/schemata_json_schema/src/Normalizer/jsonapi/SchemataSchemaNormalizer.php
@@ -46,7 +46,7 @@ class SchemataSchemaNormalizer extends JsonApiNormalizerBase {
'type' => 'string',
'title' => 'type',
'description' => t('Resource type'),
- 'enum' => [$resource_type->getTypeName()]
+ 'enum' => [$resource_type ? $resource_type->getTypeName() : $entity->getEntityTypeId()]
],
'id' => [
'type' => 'string',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment