mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-03-02 09:29:13 +00:00
Mark it has an error if a JSON Array is empty
This commit is contained in:
parent
02b49913b0
commit
a658fc982b
@ -208,6 +208,9 @@ public class JsonParser extends ParserBase {
|
||||
JsonElement e = object.get(name);
|
||||
if (property.isList() && (e instanceof JsonArray)) {
|
||||
JsonArray arr = (JsonArray) e;
|
||||
if (arr.size() == 0) {
|
||||
logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.ARRAY_CANNOT_BE_EMPTY), IssueSeverity.ERROR);
|
||||
}
|
||||
int c = 0;
|
||||
for (JsonElement am : arr) {
|
||||
parseChildComplexInstance(npath+"["+c+"]", object, element, property, name, am);
|
||||
|
2
pom.xml
2
pom.xml
@ -19,7 +19,7 @@
|
||||
|
||||
<properties>
|
||||
<hapi_fhir_version>5.1.0</hapi_fhir_version>
|
||||
<validator_test_case_version>1.1.46</validator_test_case_version>
|
||||
<validator_test_case_version>1.1.47-SNAPSHOT</validator_test_case_version>
|
||||
<junit_jupiter_version>5.6.2</junit_jupiter_version>
|
||||
<maven_surefire_version>3.0.0-M4</maven_surefire_version>
|
||||
<jacoco_version>0.8.5</jacoco_version>
|
||||
|
Loading…
x
Reference in New Issue
Block a user