src/Normalizer/JsonApiDocumentTopLevelNormalizer.php | 2 ++ tests/src/Functional/BlockContentTypeTest.php | 8 ++++++++ tests/src/Functional/TermTest.php | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php b/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php index d82b1d6..4a947d0 100644 --- a/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php +++ b/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php @@ -179,6 +179,8 @@ class JsonApiDocumentTopLevelNormalizer extends NormalizerBase implements Denorm foreach ($included as $included_item) { if ($included_item['data'] === FALSE) { unset($included_item['data']); + unset($included_item['jsonapi']); + unset($included_item['links']); $normalized = NestedArray::mergeDeep($normalized, $included_item); } else { diff --git a/tests/src/Functional/BlockContentTypeTest.php b/tests/src/Functional/BlockContentTypeTest.php index f114ac5..5ba2d19 100644 --- a/tests/src/Functional/BlockContentTypeTest.php +++ b/tests/src/Functional/BlockContentTypeTest.php @@ -72,12 +72,20 @@ class BlockContentTypeTest extends ResourceTestBase { 'version' => '1.0', 'profiles' => [ 'https://www.drupal.org/jsonapi/profile/fancy_filters' => [], + 'https://www.drupal.org/jsonapi/profile/page_limit' => [], + 'https://www.drupal.org/jsonapi/profile/sort_language' => [], ], 'links' => [ 'profile' => [ [ 'href' => 'https://www.drupal.org/jsonapi/profile/fancy_filters', ], + [ + 'href' => 'https://www.drupal.org/jsonapi/profile/page_limit', + ], + [ + 'href' => 'https://www.drupal.org/jsonapi/profile/sort_language', + ], ], ], ], diff --git a/tests/src/Functional/TermTest.php b/tests/src/Functional/TermTest.php index b0e12af..2641864 100644 --- a/tests/src/Functional/TermTest.php +++ b/tests/src/Functional/TermTest.php @@ -345,6 +345,24 @@ class TermTest extends ResourceTestBase { ], ], 'version' => '1.0', + 'profiles' => [ + 'https://www.drupal.org/jsonapi/profile/fancy_filters' => [], + 'https://www.drupal.org/jsonapi/profile/page_limit' => [], + 'https://www.drupal.org/jsonapi/profile/sort_language' => [], + ], + 'links' => [ + 'profile' => [ + [ + 'href' => 'https://www.drupal.org/jsonapi/profile/fancy_filters', + ], + [ + 'href' => 'https://www.drupal.org/jsonapi/profile/page_limit', + ], + [ + 'href' => 'https://www.drupal.org/jsonapi/profile/sort_language', + ], + ], + ], ], 'links' => ['self' => static::getRelatedLink(static::toResourceIdentifier($this->entity), 'parent')], ]);