Call to a member function getName() on null when generating the schema for contact_message

Created on 4 March 2024, about 1 year ago
Updated 8 March 2024, about 1 year ago

Problem/Motivation

contact_message isn't supported yet. The following error is thrown:

Error: Call to a member function getName() on null in Drupal\jsonapi\Normalizer\ResourceObjectNormalizer->processContentEntitySchema() (line 320 of core/modules/jsonapi/src/Normalizer/ResourceObjectNormalizer.php).

Drupal\jsonapi\Normalizer\ResourceObjectNormalizer->getNormalizationSchema(Object, Array) (Line: 28)
Drupal\jsonapi\Normalizer\ResourceObjectNormalizer->normalize(Object, 'json_schema', Array) (Line: 159)
Symfony\Component\Serializer\Serializer->normalize(Object, 'json_schema', Array) (Line: 66)
Drupal\jsonapi\Serializer\Serializer->normalize(Object, 'json_schema') (Line: 900)
Drupal\openapi_jsonapi\Plugin\openapi\OpenApiGenerator\JsonApiGenerator->getJsonSchema('contact_message', 'feedback') (Line: 389)
Drupal\openapi\Plugin\openapi\OpenApiGeneratorBase->getDefinitionReference('contact_message', 'feedback') (Line: 691)
Drupal\openapi_jsonapi\Plugin\openapi\OpenApiGenerator\JsonApiGenerator->getRequestBody(Object, 'post', 'jsonapi.contact_message--feedback.collection.post', Object) (Line: 271)
Drupal\openapi_jsonapi\Plugin\openapi\OpenApiGenerator\JsonApiGenerator->getPathItems() (Line: 204)
Drupal\openapi\Plugin\openapi\OpenApiGeneratorBase->getSpecification() (Line: 39)
Drupal\openapi\Controller\ApiSpecificationController->getSpecification(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 715)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

- Install Umami on Drupal 11
- Apply https://www.drupal.org/project/drupal/issues/3031367 Introduce "schematic" normalizers Active
- Enable openapi_jsonapi
- Go to the openapi spec

Proposed resolution

Add support for contact_message

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

🇧🇪Belgium mpp

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024