This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-e2a46e71-b892-4f48-be6b-059bf83db07d XWIKI-25300 Open

Allow setting the version comment when modifying xobjects through the REST API, and support minorRevision when deleting one

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-95863aa3-c24b-4397-bd80-9020294a5093 Vincent Massol created this issue on 14/Oct/26 19:57
 
Summary: Allow setting the version comment when modifying xobjects through the REST API, and support minorRevision when deleting one
Issue Type: cid:jira-generated-image-avatar-e2a46e71-b892-4f48-be6b-059bf83db07d Improvement
Affects Versions: 17.10.0
Assignee: Unassigned
Components: REST
Created: 14/Oct/26 19:57
Priority: cid:jira-generated-image-static-major-ad2822a0-e924-478f-9bd6-4e77c2752cfe Major
Reporter: Vincent Massol
Description:

When a page's xobjects are modified through the REST API, the resulting page version always has an empty version comment, and deleting an xobject always creates a major version. Only the page resource lets the caller set the version comment (<comment> in the <page> body).

As a consequence, a client that edits object properties (for example a documentation page's structured fields) cannot explain the change in the page history, and a client deleting an object cannot mark it as a minor edit.

Current behavior

  • {{PUT /wikis/ {wiki}/spaces/{space}/pages/{page}/objects/{class}/{n}/properties/{prop}}} (ObjectPropertyResourceImpl): doc.save("", minorRevision)
    * {{PUT /wikis/{wiki}

    /spaces/

    {space}/pages/{page}/objects/{class}/{n}}} (ObjectResourceImpl#updateObject): doc.save("", minorRevision)
    * {{POST /wikis/{wiki}/spaces/{space}

    /pages/

    {page}/objects}} (ObjectsResourceImpl): doc.save("", minorRevision)
    * {{DELETE /wikis/{wiki}/spaces/{space}/pages/{page}

    /objects/

    {class}

    /

    {n}

    }} (ObjectResourceImpl#deleteObject): doc.save(), no minorRevision parameter and no comment

The minorRevision query parameter was added to the first three in XWIKI-15120.

Proposal

  • Add an optional comment query parameter to the object and object property write endpoints (PUT/POST/DELETE), used as the version comment.
  • Support minorRevision on the object DELETE endpoint, like on the other object endpoints.
 
 

1 update

 
cid:jira-generated-image-avatar-95863aa3-c24b-4397-bd80-9020294a5093 Changes by Vincent Massol on 14/Oct/26 19:59
 
Description: When a page's xobjects are modified through the REST API, the resulting page version always has an empty version comment, and deleting an xobject always creates a major version. Only the page resource lets the caller set the version comment ({{<comment>}} in the {{<page>}} body).

As a consequence, a client that edits object properties (for example a documentation page's structured fields) cannot explain the change in the page history, and a client deleting an object cannot mark it as a minor edit.

h2. Current behavior

* {{PUT /wikis/
{ < wiki } > /spaces/ { < space } > /pages/ { < page } > /objects/ { < class } > / { < n } > /properties/ { < prop > }} } ({{ObjectPropertyResourceImpl}}): {{doc.save("", minorRevision)}}
* {{PUT /wikis/
{ < wiki } > /spaces/ { < space } > /pages/ { < page } > /objects/ { < class } > / { < n > }} } ({{ObjectResourceImpl#updateObject}}): {{doc.save("", minorRevision)}}
* {{POST /wikis/
{ < wiki } > /spaces/ { < space } > /pages/ { < page } > /objects}} ({{ObjectsResourceImpl}}): {{doc.save("", minorRevision)}}
* {{DELETE /wikis/
{ < wiki } > /spaces/ { < space } > /pages/ { < page } > /objects/ { < class } > / { < n > }} } ({{ObjectResourceImpl#deleteObject}}): {{doc.save()}}, no {{minorRevision}} parameter and no comment

The {{minorRevision}} query parameter was added to the first three in XWIKI-15120.

h2. Proposal

* Add an optional {{comment}} query parameter to the object and object property write endpoints (PUT/POST/DELETE), used as the version comment.
* Support {{minorRevision}} on the object DELETE endpoint, like on the other object endpoints.