Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25300

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 18.10.0-rc-1
    • 17.10.0
    • REST
    • None
    • Unknown

    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.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: