Merge pull request #124 from hapifhir/fix_uri_whitespace_check

fixed check for "URI values cannot have whitespace"
This commit is contained in:
Grahame Grieve 2020-01-21 06:48:22 +11:00 committed by GitHub
commit a72c5567fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1900,9 +1900,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (type.equals("uri") || type.equals("oid") || type.equals("uuid") || type.equals("url") || type.equals("canonical")) {
rule(errors, IssueType.INVALID, e.line(), e.col(), path, !e.primitiveValue().startsWith("oid:"), "URI values cannot start with oid:");
rule(errors, IssueType.INVALID, e.line(), e.col(), path, !e.primitiveValue().startsWith("uuid:"), "URI values cannot start with uuid:");
rule(errors, IssueType.INVALID, e.line(), e.col(), path, e.primitiveValue().equals(e.primitiveValue().trim().replace(" ", ""))
rule(errors, IssueType.INVALID, e.line(), e.col(), path, (e.primitiveValue().equals(e.primitiveValue().trim().replace(" ", ""))
// work around an old invalid example in a core package
&& !"http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri".equals(e.primitiveValue()), "URI values cannot have whitespace('"+e.primitiveValue()+"')");
|| "http://www.acme.com/identifiers/patient or urn:ietf:rfc:3986 if the Identifier.value itself is a full uri".equals(e.primitiveValue())), "URI values cannot have whitespace('"+e.primitiveValue()+"')");
rule(errors, IssueType.INVALID, e.line(), e.col(), path, !context.hasMaxLength() || context.getMaxLength()==0 || e.primitiveValue().length() <= context.getMaxLength(), "value is longer than permitted maximum length of " + context.getMaxLength());