Conversation
|
Thanks for submitting an RFC! Please can you renumber this to 22? |
|
Thanks for submitting this, and sorry for the delay in responding. I have a couple of questions:
|
|
Time flies when you're having fun. I kinda lost interest after last year's sprint, but hey, I just joined this year's sprint. I'll have a chat with @tomdyson shortly on this topic, so more info will follow. |
auvipy
left a comment
There was a problem hiding this comment.
how about using django-rest-framework-json-api for this?
|
I haven't checked this package(django-rest-framework-json-api) before, but see that the idea is to implement a JSON:API compliant REST API. I did a quick scan of the JSON:API project, but have no idea how viable it is. Doesn't strike me as something that is overly hip and happening in the world. I suppose it is the choice of the Wagtail core team what way to go with this, but it would require some serious study to prevent betting on a dead horse (as they say in at least some languages...). |
|
There is no technical objection for implementing the API according to jsonapi, but again: this is a decision that needs to be taken by the core team. So far however, no one seems to be overly interested. What I do see however, is that no big companies, nor foundations seem to be backing up the jsonapi.org effort, which is usually not a good sign. |
|
Companies I know of: |
auvipy
left a comment
There was a problem hiding this comment.
this package can be helpful to achieve HATEOS using drf https://github.com/django-json-api/django-rest-framework-json-api
|
Django REST Framework suggests JSON:API as an option to implement HATEOS using DRF. Also the examples seen in the RFC, I can relate to them with JSON:API specs. But yup the decisions are up to the maintainers. |
There was a problem hiding this comment.
Coming back to this after RFC #100, I’m skeptical this is a good fit for Wagtail core. I think the RFC should either be updated to explain why this makes sense as a core feature, rather than the theory of why HATEOAS is good.
I like HATEOAS in principle and JSON:API as a practical way to make this happen, but there just doesn’t seem to be enough interest in this to make it part of the core implementation? This seems primarily useful if you publish an API intended for others to reuse. While from what I’ve seen the majority of Wagtail implementers who set up APIs is for "their" own consumption (mobile app, headless site, other ad-hoc need).
| A typical example in the context of a CMS would be the representation | ||
| of a page. Let us assume that a page can either be public, or private, | ||
| and that a consumer with the proper authorisation can change this | ||
| state. A representation of the page would then not only need to show |
There was a problem hiding this comment.
If we want to demonstrate the relevance of HATEOAS in the context of Wagtail I think we should do this without relying on authorization or "write API" use cases. This isn’t a typical example, there are sites that do this but most of the CMS-driven content shared over an API I see out there seems to be read-only. There might be some form of authentication but I’ve not seen much in the space of authorisation at all.
See the 2024 headless survey, where the "admin API" improvements are ranked lowest as far as priority for Wagtail users.
| 1. implement a root view for the API, where all available resources | ||
| are listed, so a consumer can start navigation from here; |
There was a problem hiding this comment.
See Wagtail API should have a browsable root URL #1921. Neat idea. I think the RFC should refer to this.
|
|
||
| 1. implement a root view for the API, where all available resources | ||
| are listed, so a consumer can start navigation from here; | ||
| 2. implement HATEOAS for all resources using the *_links* meta property; |
There was a problem hiding this comment.
This should be expanded. To me that’s what would be most interesting to cover in RFC format, going beyond why HATEOAS is interesting.
I added a first draft for the implementation of HATEOAS for the Wagtail API. There's probably some more guidelines to add, but maybe first it's time for a bit of shooting...