mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-13 16:24:44 +00:00
Fix problem validating json key value pairs
This commit is contained in:
parent
1850995465
commit
8a9039f08f
@ -163,6 +163,7 @@ public class Element extends Base implements NamedItem {
|
||||
private Object nativeObject;
|
||||
private List<SliceDefinition> sliceDefinitions;
|
||||
private boolean elided;
|
||||
private ElementDefinition valueProperty; // used to track the property value for JSON Key properties in logical models
|
||||
|
||||
public Element(String name) {
|
||||
super();
|
||||
@ -1648,4 +1649,13 @@ public class Element extends Base implements NamedItem {
|
||||
public boolean isElided() {
|
||||
return this.elided;
|
||||
}
|
||||
|
||||
public ElementDefinition getValueProperty() {
|
||||
return valueProperty;
|
||||
}
|
||||
|
||||
public void setValueProperty(ElementDefinition valueProperty) {
|
||||
this.valueProperty = valueProperty;
|
||||
}
|
||||
|
||||
}
|
@ -469,7 +469,7 @@ public class JsonParser extends ParserBase {
|
||||
nKey.setPath(fpathKey);
|
||||
n.getChildren().add(nKey);
|
||||
nKey.setValue(pv.getName());
|
||||
|
||||
nKey.setValueProperty(propV.getDefinition());
|
||||
|
||||
boolean ok = true;
|
||||
Property pvl = propV;
|
||||
@ -573,7 +573,8 @@ public class JsonParser extends ParserBase {
|
||||
n.setNull(true);
|
||||
// nothing to do, it's ok, but we treat it like it doesn't exist
|
||||
} else {
|
||||
logError(errors, ValidationMessage.NO_RULE_DATE, line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE__NOT_, (property.isList() ? "an Array" : "an Object"), describe(e), name, npath), IssueSeverity.ERROR);
|
||||
String msg = context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE__NOT_, (property.isList() ? "an Array" : "an Object"), describe(e), name, npath);
|
||||
logError(errors, ValidationMessage.NO_RULE_DATE, line(e), col(e), npath, IssueType.INVALID, msg, IssueSeverity.ERROR);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user