diff options
author | 2018-01-12 14:50:36 -0500 | |
---|---|---|
committer | 2018-01-12 14:52:01 -0500 | |
commit | f4c0fb22527af010761fee9955504bac72ca55db (patch) | |
tree | 6fc4d9a4798caea9857f6decbc46b5ab1745507e /src/main/java/org/onap/crud/service/CrudRestService.java | |
parent | 4141124d43da1503193416a7d23fc07cec308049 (diff) |
Allow patch operation in bulk request
Support the patch operation in a bulk request.
Change-Id: I10054f60315632812bed18997272a5c9728a3f67
Issue-ID: AAI-482
Signed-off-by: sblimkie <steven.blimkie@amdocs.com>
Diffstat (limited to 'src/main/java/org/onap/crud/service/CrudRestService.java')
-rw-r--r-- | src/main/java/org/onap/crud/service/CrudRestService.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/onap/crud/service/CrudRestService.java b/src/main/java/org/onap/crud/service/CrudRestService.java index d00323e..0ea07f0 100644 --- a/src/main/java/org/onap/crud/service/CrudRestService.java +++ b/src/main/java/org/onap/crud/service/CrudRestService.java @@ -451,11 +451,13 @@ public class CrudRestService { if (!opr.getValue().getAsString().equalsIgnoreCase("add") && !opr.getValue().getAsString().equalsIgnoreCase("modify") + && !opr.getValue().getAsString().equalsIgnoreCase("patch") && !opr.getValue().getAsString().equalsIgnoreCase("delete")) { throw new CrudException("Invalid operation at item: " + item.getKey(), Status.BAD_REQUEST); } - // check if ID is populate for modify/delete operation + // check if ID is populate for modify/patch/delete operation if ((opr.getValue().getAsString().equalsIgnoreCase("modify") + || opr.getValue().getAsString().equalsIgnoreCase("patch") || opr.getValue().getAsString().equalsIgnoreCase("delete")) && (vertexPayload.getId() == null)) { throw new CrudException("Mising ID at item: " + item.getKey(), Status.BAD_REQUEST); @@ -491,11 +493,13 @@ public class CrudRestService { if (!opr.getValue().getAsString().equalsIgnoreCase("add") && !opr.getValue().getAsString().equalsIgnoreCase("modify") + && !opr.getValue().getAsString().equalsIgnoreCase("patch") && !opr.getValue().getAsString().equalsIgnoreCase("delete")) { throw new CrudException("Invalid operation at item: " + item.getKey(), Status.BAD_REQUEST); } - // check if ID is populate for modify/delete operation + // check if ID is populate for modify/patch/delete operation if ((edgePayload.getId() == null) && (opr.getValue().getAsString().equalsIgnoreCase("modify") + || opr.getValue().getAsString().equalsIgnoreCase("patch") || opr.getValue().getAsString().equalsIgnoreCase("delete"))) { throw new CrudException("Mising ID at item: " + item.getKey(), Status.BAD_REQUEST); |