State of JSON:API (January 2019)

published on January 21, 2019

As promised 3 months ago, Gabe, Mateu and I together with twelve other contributors shipped support for revisions and file uploads today!

What happened since last month? In a nutshell:

JSON:API 2.1

JSON:API 2.1 follows two weeks after 2.0.

Work-arounds for two very common use cases are no longer necessary: decoupled UIs that are capable of previews and image uploads4.

  • File uploads work similarly to Drupal core’s file uploads in the REST module, with the exception that a simpler developer experience is available when uploading files to an entity that already exists.
  • Revision support is for now limited to retrieving the working copy of an entity using ?resourceVersion=rel:working-copy. This enables the use case we hear about the most: previewing draft Nodes. 5 Browsing all revisions is not yet possible due to missing infrastructure in Drupal core. With this, JSON:API leaps ahead of core’s REST API.

Please share your experience with using the JSON:API module!


  1. This was in the making for most of 2018, see the SA for details. ↩︎

  2. Note that usage statistics on drupal.org are an underestimation! Any site can opt out from reporting back, and composer-based installs don’t report back by default. ↩︎

  3. Which we can do thanks to the tightly managed API surface of the JSON:API module. ↩︎

  4. These were in fact the two feature requests with the highest number of followers↩︎

  5. Unfortunately only Node and Media entities are supported, since other entity types don’t have standardized revision access control. ↩︎

Comments

Jibran's picture
Jibran

First of all, I’d like to emphasize that two lines summary doesn’t justify the work and effort went into revision support and file upload.

It is a big step forward and was a massive undertaking. All the JSON:API maintainers worked really really hard to get those ready for stable release so big thanks and lot of respect for Wim, Gabe, and Mateu.

I think we also had a security release within last month. ;-)

And I’m really excited about upcoming changes after 2.1. :D

Wim Leers's picture
Wim Leers

You’re right, I forgot about that because that happened in decembed, not January. I’ll update the blog post! Good catch :)

Wim Leers's picture
Wim Leers

Done: blog post updated! Now it mentions the security release, and it mentions how many people contributed to the 2.0 & 2.1 releases :)

Trent Stromkins's picture

Wim,

This is awesome news, one step closer to having it in Core. Thanks all for all the hard work.