Skip to main content

JSON:API Resources is Drupal 9.1 compatible

Published on

JSON:API Resources is now Drupal 9.0 and 9.1 compatible with the 8.x-1.0-beta4 release! If you are not familiar with this module, it is essentially the sandbox contributed project for building the extensibility layer for Drupal's JSON:API implementation. That is a fancy way of saying it lets you define custom endpoints that leverage the JSON:API specification.

We shipped the module with a requirement of drupal/core:^8.8@alpha as we required some code that would ship in Drupal 8.8.0. Howevever, we never released the fix for the composer.json file to allow installation of th module with Drupal 9!

I made a commit nine months ago fixing it. But I never got around to making a release 😬.


This is a pretty big deal because it unblocks most of (the entire?) JSON:API contrib ecosystem for Drupal 9 support. You couldn't use JSON:API Search API, JSON:API Views, and more on Drupal 9.

This release also comes with a fix to be compatible with 9.1.0! The \Drupal\jsonapi\ResourceResponse class used to implement CacheableResponseInterface. It does not in 9.1.0 and instead there is  a new \Drupal\jsonapi\CacheableResourceResponse response class. Here's the change record:

I also tagged a new release of JSON:API User Resources (8.x-1.0-alpha4.) This included a fix to the module to make it Drupal 9 compatible. This module supports user registration and password resets over JSON:API.

The JSON:API Search API needs some updates in the tests – But it should be fine on Drupal 9, as the failures are related to test specific items.

I'm available for one-on-one consulting calls – click here to book a meeting with me 🗓️