Fix for ONOS-4740

Properly determine if the JSON payload contained any errors.

Change-Id: Id8e816f6627580dcaca3ccb6b7356d61be62392d
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/NetworkConfigWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/NetworkConfigWebResource.java
index b8dbb09..3afeb3a 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/NetworkConfigWebResource.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/NetworkConfigWebResource.java
@@ -204,7 +204,7 @@
                     errorMsgs.addAll(consumeJson(service, (ObjectNode) root.path(sk),
                                                  service.getSubjectFactory(sk)));
                 });
-        if (errorMsgs.toString().length() > 0) {
+        if (errorMsgs.size() > 0) {
             return Response.status(MULTI_STATUS_RESPONE).entity(produceErrorJson(errorMsgs)).build();
         }
         return Response.ok().build();
@@ -227,7 +227,7 @@
         NetworkConfigService service = get(NetworkConfigService.class);
         ObjectNode root = (ObjectNode) mapper().readTree(request);
         List<String> errorMsgs = consumeJson(service, root, service.getSubjectFactory(subjectClassKey));
-        if (errorMsgs.toString().length() > 0) {
+        if (errorMsgs.size() > 0) {
             return Response.status(MULTI_STATUS_RESPONE).entity(produceErrorJson(errorMsgs)).build();
         }
         return Response.ok().build();