Fix issue where primitive elements with required bindings must have a value, but this wasn't be checked

This commit is contained in:
Grahame Grieve 2021-04-21 17:41:22 +10:00
parent 7d2df18fb9
commit 7b60c1b85d

View File

@ -1907,6 +1907,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.hasChildren(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_NOTEMPTY); rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.hasChildren(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_NOTEMPTY);
else if (StringUtils.isWhitespace(e.primitiveValue())) else if (StringUtils.isWhitespace(e.primitiveValue()))
warning(errors, IssueType.INVALID, e.line(), e.col(), path, e.hasChildren(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_WS); warning(errors, IssueType.INVALID, e.line(), e.col(), path, e.hasChildren(), I18nConstants.TYPE_SPECIFIC_CHECKS_DT_PRIMITIVE_WS);
if (context.hasBinding()) {
rule(errors, IssueType.CODEINVALID, e.line(), e.col(), path, context.getBinding().getStrength() != BindingStrength.REQUIRED, I18nConstants.Terminology_TX_Code_ValueSet_MISSING);
}
return; return;
} }
String regex = context.getExtensionString(ToolingExtensions.EXT_REGEX); String regex = context.getExtensionString(ToolingExtensions.EXT_REGEX);