This is happening as part of #2757967: API-first initiative. It's the successor to #3002188: REST: top priorities for Drupal 8.7.x, which was the successor to #2941316: REST: top priorities for Drupal 8.6.x, which was the successor to #2905563: REST: top priorities for Drupal 8.5.x, which was the successor to #2852860: REST: top priorities for Drupal 8.4.x, which was the successor to #2794263: REST: top priorities for Drupal 8.3.x (and #2721489: REST: top priorities for Drupal 8.2.x before that).
Theme: Harden JSON:API and validate the big two future enablers: query builder and hypermedia.
rest.module-specific issues are marked with Ⓡ and jsonapi.module-specific issues with Ⓙ. Issues listed below without any such prefix impact all API-First modules.
If you're interested in helping out with something, come find us in #contenta on Slack.
A note about JSON:API development
Note that for the remainder of the 8.8.x cycle, for JSON:API development the following applies:
- Commits must happen against Drupal
8.8.xcore first, and are backported to8.7.xwhen core policy allows this. - Only commits to 8.7.x may be backported to the https://www.drupal.org/project/jsonapi contrib module (
8.x-2.x) - Therefore patches must be filed against the
jsonapi.modulecomponent in Drupal core. But to speed up development, you can develop the patch in the https://www.drupal.org/project/jsonapi issue queue, since tests run much faster there.
Focus for 8.8
The three API-First Initiative Coordinators @gabesullice, @e0ipso and @Wim Leers will be focusing on these 4 things for 8.8, but we'll still be looking at everything below as well, especially in a review capacity.
- ✅
Ⓙ Provide interactive documentation/query builder à la GraphiQL in a stable contrib module: https://www.drupal.org/project/jsonapi_explorer.Crucially, this involves improving normalizer infrastructure in Drupal 8.8 that will then be guaranteed to be available in Drupal 9, allowing us to have better HTTP API support in the future without breaking BC. (Ⓙ #2994473: [META] JSON API's normalizers support schema tracking, to guarantee comprehensive schema)- schematic normalizers #3031367: Generate JSON schema for content entity types
- deterministic normalizers #3031214: Introduce "deterministic" normalizers
- Ⓙ guarantee comprehensive schema, enables powerful tooling #2994473: [META] JSON API's normalizers support schema tracking, to guarantee comprehensive schema
- ✅
Ⓙ Hypermedia adoption #2994193: [META] The Last Link: A Hypermedia Story (https://www.drupal.org/project/jsonapi_hypermedia is already working sufficiently well, we just want to see more modules adopting it to help validate it further before considering making it part of the JSON:API module itself) - Ⓙ JSON:API core commit follow-up work:
- Ⓙ #3040025: [meta] Decide on and implement additional security hardenings for JSON:API and other HTTP APIs
- Ⓙ complete revision support #2795279: [PP-2] [META] Revisions support
- Ⓙ make "create new revision" optional: #2993557: Allow optional creation of new revision when PATCHing revisionable entities to support autosave functionality via JSON:API.
- Ⓙ revision negotiation: support all entity types: #3031271: Support version negotiation for any entity type (currently only Node & Media are supported)
- Ⓙ revision discovery: provide version history: #3009588: Provide a collection resource where a version history can be obtained (`version-history`, `predecessor-version` and `successor-version` link relations)
- Ⓙ regression: DELETE requests using `self` links made impossible: #3048621: [regression] Resource and relationship object `self` links can no longer be used for update/delete requests.
- Ⓙ complete translation support: #2794431: [META] Formalize translations support
- Ⓙ JSON:API cacheability/performance improvements for interacting with huge collections and/or highly complex data models
- ✅
Ⓙ #3039730: Include paths are resolved for every resource in a resource collection, instead of once per unique resource type - ✅
Ⓙ #3018287: ResourceTypeRepository computes ResourceType value objects on *every request* - ✅
Ⓙ Partial caching for entity normalization, to accelerate collections & includes #2819335: Resource (entity) normalization should use partial caching
- ✅
Any use case (fully decoupled, progressively decoupled, content sync)
- Ⓙ recommend one or more JS clients that support the widest breadth of functionality Drupal's JSON:API implementation
- Ⓙ Exploration: #3047496: Scout existing JavaScript client libraries
- Ⓙ Implementation: TBD
- Serialization gaps:
- File fields: explicit HTTP(S) file URLs: #2925520: Add a computed 'file_url' property to FileItem (for exposing file URL in file field normalization)
- Image items: image style URLs/widths/heights: #2825812: ImageItem should have an "derivatives" computed property, to expose all image style URLs
@DataType=any: #2915705: TypedData 'Any' can't be normalized to array if it stores an object- Denormalizing text fields that also include the
processedproperty fails: #2972988: Error when saving a denormalized entity with text fields with "processed" property - Link fields: #3066751: Add resolvable_uri property to LinkItem for APIs
parentfield onMenuLinkContententities: #3066768: `parent` field on MenuLinkContent entities uses `string` field type, which is semantically wrong and burdens HTTP API clients- #3067627: API users cannot access menu links
- #2915792: MenuLinkContentAccessControlHandler does not allow "view" access without admin permission, making these entities inaccessible via REST, JSON API and GraphQL and entity reference fields
- Ⓙ #3066202: Filtering multivalue reference fields to contain multiple specified values does not work
- Ⓙ Out-of-the-box path aliases in JSON:API: [issue to be created]
- Configurable fields cannot be marked internal: #3005924: Follow-up for #2871591: Marking configurable fields as internal is impossible.
- ✅
POSTed Comment entities should be owned by the currently logged in user: #2975217: Update the default comment entity owner to the current user - Field's "default value" only works in widgets/formatters, not in REST API/JSON API/GraphQL: #3005528: Fields' "default value" functionality only works in formatters and widgets, not at the data level and hence not in HTTP APIs.
- "File uploader" service to allow REST/JSON API/GraphQL/… reuse the same file upload/validation logic: #2940383: [META] Unify file upload logic of REST and JSON:API (rather than duplicating, which is very risky)
- client-generated IDs for file uploads #3021155: Accept client-generated IDs (UUIDs) for file uploads too
- Entity Query Access API #777578: Add an entity query access API and deprecate hook_query_ENTITY_TYPE_access_alter() — would have prevented https://www.drupal.org/sa-contrib-2018-081 (related: #3021930: Follow-up to SA-CONTRIB-2018-081: Restore JSON:API filter access)
- Full config entity support:
- Infrastructure: #2300677: JSON:API POST/PATCH support for fully validatable config entities
- Add validation constraints to all config entity types: #2869792: [meta] Add constraints to all config entity types (dozens of child issues there!)
DX
- Ⓙ empty relationship filtering #3025372: [regression] Impossible to filter for resources with an empty relationship object in JSON:API 2.x
- Ⓙ Implement upcoming JSON:API 1.1 release:
- Ⓙ fancy filters, sorting, pagination and relationship arity: #2955020: Spec Compliance: JSON API's profile/extention (Fancy Filters, Drupal sorting, Drupal pagination, relationship arity) needs to be explicitly communicated
- Ⓙ resource versioning profile: #3020136: Author and register a JSON:API profile for resource versioning
- Ⓙ JSON:API + maintenance mode #3049048: Invalid JSON:API responses when maintenance mode is on
Fully decoupled
Done!
Coherent API-First ecosystem
- Use
@DataType-level normalizers whenever possible:- Discourage
@FieldType-level normalizers: #2926507: Discourage @FieldType-level normalizers, encourage @DataType-level normalizers, to strengthen the API-First ecosystem
- Discourage
Velocity+maintainability+reliability+predictability
Done!
Comments
Comment #2
wim leersRemoving #2856110: [PP-1] Expose entity validation errors in a machine readable REST API: , which is blocked on #1916302: RFC 7807: "Problem Details for HTTP APIs" — serve REST error responses as application/problem+json, because (quoting myself from #1916302-30: RFC 7807: "Problem Details for HTTP APIs" — serve REST error responses as application/problem+json):
Given that, and the recommendation to use
jsonapi.moduleinstead ofrest.modulefor interacting with entities, which is where validation occurs most frequently, I am removing #2856110: [PP-1] Expose entity validation errors in a machine readable REST API: from the top priorities. (It also saw very little interest; the status quoseems to suffice.)
Comment #3
wim leersI'm marking
rest.module-specific issues with Ⓡ andjsonapi.module-specific issues with Ⓙ.Comment #4
wim leersI triaged the entire JSON:API issue queue once more.
I also took another look at the API-First Initiative Priority Matrix that @gabesullice started (thanks Gabe! 👍) and incorporated much of tha.
This issue summary is meant to evolve: feel free to reorder, add, and remove. As one thing gets blocked, others might move forward. If you're interested in helping out with something, come find us in
#contentaon Slack.There are so many things we would like to see happen. So many foundational improvements that have been holding back
rest.modulefor so long (e.g. full config entity support), have caused countless hours spent on security mitigations forjsonapi.module(e.g. Entity Query Access API), and there are things that would help both (e.g. serialization gaps, better normalizer infrastructure). Besides those foundational problems, there are many features we would like to see added to JSON:API — from more complete revision support to a query builder UI and a full-featured JS client.I know @gabesullice is going to be working on a PoC for a query builder UI soon, he's already been working on hypermedia support, and we all are already working on performance/cacheability improvements and working to complete revision support.
My focus this quarter (until the end of June) is going to be on Media embedding, so expect less from me. I will probably be back in full capacity in July.
Comment #5
wim leersNote that for the remainder of the
8.8.xcycle, for JSON:API development the following applies:8.8.xcore first, and are backported to8.7.xwhen core policy allows this.8.x-2.x)jsonapi.modulecomponent in Drupal core. But to speed up development, you can develop the patch in the https://www.drupal.org/project/jsonapi issue queue, since tests run much faster there.Comment #6
wim leers#4 just appended list items to the existing lists.
I just moved them around (without changing any): now they're in the order I think we should tackle them. Looking forward to feedback from my fellow API-First Initiative coordinators @gabesullice and @e0ipso, but also from others of course!
Comment #7
wim leersAdding a few more things from the aforementioned API-First Initiative Priority Matrix that don't yet have issues, yet I think are important for 8.8.
Comment #8
wim leersAdding four missing "Ⓙ"s.
Comment #9
e0ipsoComment #10
wim leers#2994473: [META] JSON API's normalizers support schema tracking, to guarantee comprehensive schema is apparently the meta and should've been listed after "Normalizer infrastructure:" — did that just now, thanks! 🤝
I went through the list and removed #2805279: Routing system + authentication system + format-specific routes (e.g. those in rest.module) = frustrating, unhelpful 403 responses instead of 406 responses, #2817737: A REST resource's "auth" configuration MUST be non-empty, which prevents configuring it for anon access only, #2135829: EntityResource: translations support and #2904423: Translated field denormalization creates duplicate values. Hopefully you agree with those deprioritizations. Which others would you like to remove?
Comment #11
wim leersMore deprioritizations. #2820364-57: Entity + Field + Property validation constraints are processed in the incorrect order downgraded that issue from "major" to "normal" so removing #2820364. #2847041: Add a format and start/end validation constraints to DateRangeItem to provide helpful REST/JSON:API error message also seems too small to merit being listed here.
Comment #12
gabesulliceThanks for putting this together @Wim Leers! This is really helpful.
Here are the changes I've made:
Here are the things I haven't changed, but I think should change:
Overall, I feel that this list is a bit too focused on solving edge cases rather than providing new capabilities. Do you feel that way? Maybe you do, but you think that's ideal or maybe it's just a symptom of the fact that it was derived from existing issues?
Comment #13
wim leersThanks! I support those changes :)
rest.module), especially one with a hard-to-search for name like "JSON:API" :)The intent has never been to focus on providing new capabilities. The intent is to solve challenges people are encountering in production — whether that's gaps in the existing functionality (which you rightfully describe as "edge cases" — the less edge casey things have been solved by now — but remember that your edge case may be my essential basic case!) or adding new functionality. In the past, there was almost nothing for adding new functionality. The current issue summary is for the first time listing new functionality as the majority actually! 💪
Comment #14
e0ipsoI am curious about that expectation and that perception. This is totally normal and expected in other ecosystems like node.js. If you want to expand functionality you install additional dependencies. In node in particular you install 200 npm packages every time :-P
However, I think we need to discuss this point a bit more.
I'm with Gabe here. I think one problem may be that this has been traditionally too core-focused. I am glad to see we are stepping away from that pattern 👏🏽.
About edge cases. I think that the feature spectrum is so sparsely covered that focusing in what we currently do pretty darn well to make it perfect is less important than do more things OK that we are currently not doing at all. We need to focus some more on PoC like jsonapi_hypermedia, decoupled_router, consumer_image_styles, …
I realize that doesn't go against what @Wim Leers is saying, we're probably on the same page (as usual). Just speaking my mind here.
Again, adding it in scope here doesn't necessarily mean core. Right? I'd appreciate it a lot if Simple OAuth got some love from paid & volunteer contributors. Did you know that we have a PoC for OpenID Connect in a patch that is ready to be tested? Maybe that's some stuff we can highlight to get more visibility.
Comment #15
wim leersThat's a very good point. That is what it used to mean. But back then, in #2721489: REST: top priorities for Drupal 8.2.x, API-First Drupal was basically limited to the REST API that Drupal core contained. So I think you're absolutely right that we should change this.
Sure, but A) discoverability is a big problem, B) https://www.drupal.org/project/consumers has fairly far-reaching implications on how the provided HTTP API works: you have to set up consumers, update the API client to send a consumer ID, and so on. I don't think it makes sense that Drupal core's stance would be — that's why I'm saying I think it's a basic expectation. Did that explanation result in you nodding with agreement? If not, I'm ready to give up on this and accept that Drupal core will never be able to provide image styles in its HTTP APIs out of the box.
Comment #16
e0ipsoSo it is in every package manager ever implemented. If anything the centralized nature of d.o makes things much more discoverable instead.
That is not accurate ever since two versions ago. Since 1.7 we have default consumers that are created & set up + auto-negotiated without consumer IDs. Hopefully and so on is also solved 😉
Honestly, I think that the Consumers module in core would be the first step. It's a well stablished pattern everywhere. However I don't think any of us has the energy for that at the moment.
Comment #17
wim leersI met with my fellow API-First Initiative Coordinators @e0ipso and @gabesullice to discuss this in some more detail and agree on a select few top priorities.
The outcome:
Based on this, I think the theme for this release is
Updated issue summary accordingly. More detail there.
Comment #18
wim leersTo be clear: both the query builder and hypermedia support need must happen in contrib, not in core. But both will likely need improvements in core to reach their full potential (for example schematic normalizers would help the query builder, cacheability associated with links would help hypermedia).
Comment #19
wim leersJust talked to @Dries. He’s completely +1 to our 4 top priorities in #17, and agrees with our reasoning. 👍🥳
Comment #20
wim leers#3039730: Include paths are resolved for every resource in a resource collection, instead of once per unique resource type landed last week!
Comment #21
wim leers@justafish raised two more serialization gaps on today's API-First Initiative meeting: #3066751: Add resolvable_uri property to LinkItem for APIs + #3066768: `parent` field on MenuLinkContent entities uses `string` field type, which is semantically wrong and burdens HTTP API clients.
Comment #22
wim leers#2819335: Resource (entity) normalization should use partial caching landed!
Comment #23
wim leersI've been triaging the issue queue of the
jsonapi.modulecomponent in Drupal core. I have good news and bad news.Entity APIcomponent in core, not in JSON:APIcomment.modulecomponent in core, not in JSON:APImenu_link_content.modulecomponent in core, not in JSON:API, and an issue for exists already: #2915792: MenuLinkContentAccessControlHandler does not allow "view" access without admin permission, making these entities inaccessible via REST, JSON API and GraphQL and entity reference fieldsIt seems the majority of bugs being reported against JSON:API are bugs elsewhere in Drupal core. This is actually encouraging, because it means it’s no longer the HTTP API-providing module that gets in the way, it’s the rest of Drupal that actually needs to be thinking of becoming actually API-First. It's also encouraging because it means more people are building more advanced things on top of Drupal core's JSON:API than they were on the REST API.
Comment #24
wim leers#3018287: ResourceTypeRepository computes ResourceType value objects on *every request* landed!
Comment #25
wim leersAdded #2975217: Update the default comment entity owner to the current user.
Comment #26
wim leers#2994193: [META] The Last Link: A Hypermedia Story was completed in 2019!
Comment #27
wim leersWith https://www.drupal.org/project/jsonapi_explorer having been released, is also definitely completed. But the underlying infrastructure work has not yet been completed, which limits the reliability of the explorer: in case a site is customizing normalizers, it may break. Still, the current version of it is working and already is a huge enabler!
Comment #28
wim leersSignificant progress was made on #3040025: [meta] Decide on and implement additional security hardenings for JSON:API and other HTTP APIs too, but it's been blocked on framework manager review for nearly 6 months now.
Comment #29
nod_Renaming to be more accurate :)
Comment #30
wim leersShouldn't we just close this since #2757967: API-first initiative has been closed? 🤓
Comment #31
nod_You'd be the one to know :)
Comment #32
wim leersHehe 😅
Restoring previous title; it's in line with all preceding sibling issues.
End of an era! 😊