Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7553

Sling POST servlet - expand Patch method integration tests.

    XMLWordPrintableJSON

    Details

    • Flags:
      Patch

      Description

      Per the discussion at:

      https://lists.apache.org/thread.html/a57cec24f459fa0972c93ef4a2759755435a77d6a9c590e7a23440d4@%3Cusers.sling.apache.org%3E

      I was trying to include an empty string[] property in nodes created with the POST servlet to avoid errors when adapting the nodes to Sling models, and found that the Patch method supported this by adding and removing a property on a newly created node in the same operation.

       

      At present this behavior is undocumented.  If we wish to clarify the behavior, it seems that there are two possibilities:

      • Document the current behavior (it appears that Patch operations are applied in sequence).  For this case, I have attached a patch to the integration tests that tests adding and removing a property for a new node, as well as removing and adding a property.
      • Update the documentation to state that the behavior for adding and removing in the same operation is unspecified and therefore should not be relied upon.

      I have no preference, as I've since switched to the more natural approach of using a default value attribute on the model classes to solve my original problem.

        Attachments

          Activity

            People

            • Assignee:
              rombert Robert Munteanu
              Reporter:
              nerff John Logan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: