mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-09 14:24:44 +00:00
Merge remote-tracking branch 'origin/master' into i18n
This commit is contained in:
commit
f5a7961ef7
@ -254,7 +254,17 @@ public class JsonParser extends ParserBase {
|
|||||||
JsonElement main = object.has(name) ? object.get(name) : null;
|
JsonElement main = object.has(name) ? object.get(name) : null;
|
||||||
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
|
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
|
||||||
if (main != null || fork != null) {
|
if (main != null || fork != null) {
|
||||||
if (property.isList() && ((main == null) || (main instanceof JsonArray)) &&((fork == null) || (fork instanceof JsonArray)) ) {
|
if (property.isList()) {
|
||||||
|
boolean ok = true;
|
||||||
|
if (!(main == null || main instanceof JsonArray)) {
|
||||||
|
logError(line(main), col(main), npath, IssueType.INVALID, "This property must be an Array, not a "+describe(main), IssueSeverity.ERROR);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
if (!(fork == null || fork instanceof JsonArray)) {
|
||||||
|
logError(line(fork), col(fork), npath, IssueType.INVALID, "This base property must be an Array, not a "+describe(main), IssueSeverity.ERROR);
|
||||||
|
ok = false;
|
||||||
|
}
|
||||||
|
if (ok) {
|
||||||
JsonArray arr1 = (JsonArray) main;
|
JsonArray arr1 = (JsonArray) main;
|
||||||
JsonArray arr2 = (JsonArray) fork;
|
JsonArray arr2 = (JsonArray) fork;
|
||||||
for (int i = 0; i < Math.max(arrC(arr1), arrC(arr2)); i++) {
|
for (int i = 0; i < Math.max(arrC(arr1), arrC(arr2)); i++) {
|
||||||
@ -262,10 +272,12 @@ public class JsonParser extends ParserBase {
|
|||||||
JsonElement f = arrI(arr2, i);
|
JsonElement f = arrI(arr2, i);
|
||||||
parseChildPrimitiveInstance(context, property, name, npath, m, f);
|
parseChildPrimitiveInstance(context, property, name, npath, m, f);
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
} else {
|
||||||
parseChildPrimitiveInstance(context, property, name, npath, main, fork);
|
parseChildPrimitiveInstance(context, property, name, npath, main, fork);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private JsonElement arrI(JsonArray arr, int i) {
|
private JsonElement arrI(JsonArray arr, int i) {
|
||||||
return arr == null || i >= arr.size() || arr.get(i) instanceof JsonNull ? null : arr.get(i);
|
return arr == null || i >= arr.size() || arr.get(i) instanceof JsonNull ? null : arr.get(i);
|
||||||
|
@ -324,7 +324,7 @@ public class ValidationTestSuite implements IEvaluationContext, IValidatorResour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (TestingUtilities.context(version).isNoTerminologyServer() || !focus.has("tx-dependent")) {
|
if (!TestingUtilities.context(version).isNoTerminologyServer() || !focus.has("tx-dependent")) {
|
||||||
Assert.assertEquals("Expected "+Integer.toString(java.get("errorCount").getAsInt())+" errors, but found "+Integer.toString(ec)+".", java.get("errorCount").getAsInt(), ec);
|
Assert.assertEquals("Expected "+Integer.toString(java.get("errorCount").getAsInt())+" errors, but found "+Integer.toString(ec)+".", java.get("errorCount").getAsInt(), ec);
|
||||||
if (java.has("warningCount"))
|
if (java.has("warningCount"))
|
||||||
Assert.assertEquals("Expected "+Integer.toString(java.get("warningCount").getAsInt())+" warnings, but found "+Integer.toString(wc)+".", java.get("warningCount").getAsInt(), wc);
|
Assert.assertEquals("Expected "+Integer.toString(java.get("warningCount").getAsInt())+" warnings, but found "+Integer.toString(wc)+".", java.get("warningCount").getAsInt(), wc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user