jsonWriter.beginObject();
jsonWriter.name("patch-id").value(patchStatusContext.getPatchId());
if (patchStatusContext.isOk()) {
- jsonWriter.name("ok").nullValue();
+ reportSuccess(jsonWriter);
} else {
if (patchStatusContext.getGlobalErrors() != null) {
reportErrors(patchStatusContext.getGlobalErrors(), jsonWriter);
reportErrors(patchStatusEntity.getEditErrors(), jsonWriter);
} else {
if (patchStatusEntity.isOk()) {
- jsonWriter.name("ok").nullValue();
+ reportSuccess(jsonWriter);
}
}
jsonWriter.endObject();
}
+ private void reportSuccess(JsonWriter jsonWriter) throws IOException {
+ jsonWriter.name("ok").beginArray().nullValue().endArray();
+ }
+
private static void reportErrors(List<RestconfError> errors, JsonWriter jsonWriter) throws IOException {
jsonWriter.name("errors");
jsonWriter.beginObject();