A JSON:API response failed validation

Created on 3 May 2023, about 1 year ago
Updated 23 May 2024, about 1 month ago

Problem/Motivation

I'm using JSON:API and JSON:API Extras
When I query /jsonapi/pathauto_pattern/pathauto_pattern (also manually via url) I get a WSOD

The website encountered an unexpected error. Please try again later.
AssertionError: A JSON:API response failed validation (see the logs for details). Please report this in the issue queue on drupal.org in assert() (line 117 of core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php).
assert(, 'A JSON:API response failed validation (see the logs for details). Please report this in the issue queue on drupal.org') (Line: 117)
Drupal\jsonapi\EventSubscriber\ResourceResponseValidator->doValidateResponse(Object, Object) (Line: 108)
Drupal\jsonapi\EventSubscriber\ResourceResponseValidator->onResponse(Object, 'kernel.response', Object)
call_user_func(Array, Object, 'kernel.response', Object) (Line: 142)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 202)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 190)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Drupal 9.5.5
PHP 8.1
Enable default JSON:API and JSON:API Extras
Using default settings

πŸ› Bug report
Status

Postponed: needs info

Version

3.23

Component

Code

Created by

πŸ‡ΏπŸ‡¦South Africa stewest Cape Town

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

Comments & Activities

  • Issue created by @stewest
  • πŸ‡ΏπŸ‡¦South Africa stewest Cape Town
  • Status changed to Closed: works as designed about 1 year ago
  • πŸ‡ΏπŸ‡¦South Africa stewest Cape Town

    Seems to be a permission issue, but if one disables /jsonapi/pathauto_pattern/pathauto_pattern the issue goes away and Gatsby is able to connect. So perhaps it is not such an issue.

  • πŸ‡§πŸ‡·Brazil barone Belo Horizonte

    This issue still persists as of
    Drupal 9.5.11
    jsonapi_extras 8.x-3.24

    Can you please confirm the URL? The /jsonapi/pathauto_pattern/pathauto_pattern does not exists.

  • πŸ‡«πŸ‡·France lguigo

    This issue still persists as of
    Drupal 9.5.11
    jsonapi_extras 8.x-3.24

    in "include=field_image,field_mockup,field_sommaire,field_sommaire.field_image" field "field_sommaire.field_image" give error :

    The website encountered an unexpected error. Please try again later.
    AssertionError: A JSON:API response failed validation (see the logs for details). Please report this in the issue queue on drupal.org in assert() (line 117 of core/modules/jsonapi/src/EventSubscriber/ResourceResponseValidator.php).
    assert(, 'A JSON:API response failed validation (see the logs for details). Please report this in the issue queue on drupal.org') (Line: 117)
    Drupal\jsonapi\EventSubscriber\ResourceResponseValidator->doValidateResponse(Object, Object) (Line: 108)
    Drupal\jsonapi\EventSubscriber\ResourceResponseValidator->onResponse(Object, 'kernel.response', Object)
    call_user_func(Array, Object, 'kernel.response', Object) (Line: 142)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.response') (Line: 202)
    Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1) (Line: 148)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 191)
    Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 128)
    Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 82)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 49)
    Asm89\Stack\Cors->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: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

  • Status changed to Postponed: needs info about 1 month ago
  • πŸ‡³πŸ‡±Netherlands bbrala Netherlands

    Can you give a little more info, what path? Are overwrites configured?

Production build 0.69.0 2024