Fix REST API violation of the Canvas Page PATCH operation: auto-save operations should be auto-save prefixed
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3578094. --> Reported by: [penyaskito](https://www.drupal.org/user/959536) Related to !710 >>> <h3 id="overview">Overview</h3> <p>In <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3556265" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3556265</a></span> a PATCH operation for canvas content was added. The docblock states </p> <pre>Unpublishes or publishes entity through auto-save.</pre><p>That's a REST API violation, because of the stateless nature (it receives a <code>clientInstanceId</code>). None of of the other methods in this API require such a thing. </p> <p>Even if we might not want to be purist but pragmatic, it also uses the <code>'/canvas/api/v0/content/canvas_page/{canvas_page}'</code> path, which is needed for an actual Canvas Page API (<span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3575144" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3575144</a></span>). Also is not consistent with other paths that affect auto-save data, which are prefixed with auto-save. e.g. <code>canvas.api.config.auto-save.patch</code>:</p> <pre>&nbsp; path: '/canvas/api/v0/config/auto-save/{canvas_config_entity_type_id}/{canvas_config_entity}'<br>&nbsp; defaults:<br>&nbsp;&nbsp;&nbsp; _controller: 'Drupal\canvas\Controller\ApiConfigAutoSaveControllers::patch'</pre><h3 id="proposed-resolution">Proposed resolution</h3> <ul> <li>Create <code>Drupal\canvas\Controller\ApiContentAutoSaveControllers</code> if doesn't exist yet.</li> <li>Move the current implementation <code>'Drupal\canvas\Controller\ApiContentControllers::patch</code> there.</li> <li>Change the path to <code>'/canvas/api/v0/content/auto-save/{content_entity_type_id}/{content_entity}'</code></li> </ul> <h3 id="ui-changes">User interface changes</h3> <p>None.</p> > Related issue: [Issue #3556265](https://www.drupal.org/node/3556265)
issue