Details
-
Test
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
Launchpad Integration Tests 1.0.6
-
None
-
Patch
Description
Per the discussion at:
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.