Reject update request that has both script and doc

This commit is contained in:
Alexander Kahn 2013-05-09 16:54:55 -04:00 committed by Martijn van Groningen
parent 9ddd675a02
commit 47971ac808
1 changed files with 3 additions and 0 deletions

View File

@ -94,6 +94,9 @@ public class UpdateRequest extends InstanceShardOperationRequest<UpdateRequest>
if (script == null && doc == null) {
validationException = addValidationError("script or doc is missing", validationException);
}
if (script != null && doc != null) {
validationException = addValidationError("can't provide both script and doc", validationException);
}
return validationException;
}