mirror of
https://github.com/hapifhir/org.hl7.fhir.core.git
synced 2025-02-15 17:24:48 +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 Object nativeObject;
|
||||||
private List<SliceDefinition> sliceDefinitions;
|
private List<SliceDefinition> sliceDefinitions;
|
||||||
private boolean elided;
|
private boolean elided;
|
||||||
|
private ElementDefinition valueProperty; // used to track the property value for JSON Key properties in logical models
|
||||||
|
|
||||||
public Element(String name) {
|
public Element(String name) {
|
||||||
super();
|
super();
|
||||||
@ -1648,4 +1649,13 @@ public class Element extends Base implements NamedItem {
|
|||||||
public boolean isElided() {
|
public boolean isElided() {
|
||||||
return this.elided;
|
return this.elided;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ElementDefinition getValueProperty() {
|
||||||
|
return valueProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValueProperty(ElementDefinition valueProperty) {
|
||||||
|
this.valueProperty = valueProperty;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -469,8 +469,8 @@ public class JsonParser extends ParserBase {
|
|||||||
nKey.setPath(fpathKey);
|
nKey.setPath(fpathKey);
|
||||||
n.getChildren().add(nKey);
|
n.getChildren().add(nKey);
|
||||||
nKey.setValue(pv.getName());
|
nKey.setValue(pv.getName());
|
||||||
|
nKey.setValueProperty(propV.getDefinition());
|
||||||
|
|
||||||
|
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
Property pvl = propV;
|
Property pvl = propV;
|
||||||
if (propV.isJsonPrimitiveChoice()) {
|
if (propV.isJsonPrimitiveChoice()) {
|
||||||
@ -573,7 +573,8 @@ public class JsonParser extends ParserBase {
|
|||||||
n.setNull(true);
|
n.setNull(true);
|
||||||
// nothing to do, it's ok, but we treat it like it doesn't exist
|
// nothing to do, it's ok, but we treat it like it doesn't exist
|
||||||
} else {
|
} 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;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user