Problem/Motivation

Drupal 8's REST supports POST instead of PUT, however the docs still mention PUT.

Proposed resolution

Change the docs to state that the rest module supports POST, and that it doesn't explicitly support PUT.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Beta phase evaluation

\

Reference: https://www.drupal.org/core/beta-changes
Issue category Bug because the documentation of the rest module is inaccurate, specifying only PUT requests are supported where that should be POST requests are supported, and PUT requests have implicit support.
Issue priority Normal because it has an isolated impact.
Unfrozen changes Unfrozen because it only changes documentation of the rest module to be more precise.
Prioritized changes None
Disruption None
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Cyberwolf’s picture

Cyberwolf’s picture

Status: Active » Needs review
R.Muilwijk’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs review

But there is plenty of occurrences of PUT still in the rest module? Is this really correct?

dawehner’s picture

As far as I understand it is that rest module itself is generic enough to be able to also support PUT, but at least the entity specific plugin,
does not support it at the moment.

jhedstrom’s picture

Perhaps the docs should mention that PUT support is limited rather than remove entirely?

klausi’s picture

Status: Needs review » Needs work

Yeah, let's still mention PUT but also add something like "(currently unused by generic entity resources)".

bhavinvora’s picture

bhavinvora’s picture

Status: Needs work » Needs review

Anonymous’s picture

Status: Needs review » Needs work

The patch in #8 removes two files. That is probably unintended.

Furthermore, we do want to document the POST method, so that should be added again.

+++ b/core/core.api.php
@@ -90,7 +90,7 @@
+ * - PUT: Requests to update or create data (currently unused by generic entity resources). ¶

This line is too long (80 chars max) and also has a trailing space which should be removed.

talhaparacha’s picture

Status: Needs work » Needs review
FileSize
972 bytes

This patch might resolve the issue as per the discussion above.

Anonymous’s picture

Assigned: Cyberwolf » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Almost there!

+++ b/core/core.api.php
@@ -90,10 +90,12 @@
+ *        by entity resources).

This indentation is not correct. See here for more information.


+++ b/core/core.api.php
@@ -90,10 +90,12 @@
+ * The Drupal Core REST module provides support for GET, POST, PATCH, and DELETE

So as I understand it, there actually is support for PUT so we could add it here as well?

Furthermore, the issue summary is no longer is accurate. So we should update that as well.

Added a beta evaluation.

talhaparacha’s picture

Status: Needs work » Needs review
FileSize
967 bytes

@pjonckiere Fixed the indentation. About the other issue, I'm not sure. But considering this line "...support for GET, POST, PATCH, and DELETE quests on entities... " and comment # 5, I think we should not mention "PUT" there.

Anonymous’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Ok, that makes sense. I updated the IS to explain the change we are making.

I think this is ready to go in.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed db44068 and pushed to 8.0.x. Thanks!

  • alexpott committed db44068 on 8.0.x
    Issue #2349431 by talhaparacha, Cyberwolf, bhavinvora, pjonckiere: Docs...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.