better support for allowExamples

This commit is contained in:
Grahame Grieve 2022-08-26 21:00:50 +10:00
parent c16c88aba2
commit 5fcc1866cd
2 changed files with 13 additions and 1 deletions

View File

@ -108,4 +108,12 @@ public class CommaSeparatedStringBuilder {
}
}
public static String join(String sep, List<String> list) {
CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(sep);
for (String s : list) {
b.append(s);
}
return b.toString();
}
}

View File

@ -950,7 +950,9 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
done = true;
}
}
hint(errors, IssueType.UNKNOWN, element.line(), element.col(), path, done, I18nConstants.TERMINOLOGY_TX_SYSTEM_NOTKNOWN, system);
if (!isAllowExamples() || !Utilities.startsWithInList(system, "http://example.org", "https://example.org")) {
hint(errors, IssueType.UNKNOWN, element.line(), element.col(), path, done, I18nConstants.TERMINOLOGY_TX_SYSTEM_NOTKNOWN, system);
}
return true;
} catch (Exception e) {
return true;
@ -3205,6 +3207,8 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
if (pol == ReferenceValidationPolicy.CHECK_VALID) {
// todo....
}
// todo: if the content is a resource, check that Reference.type is describing a resource
}
private boolean isSuspiciousReference(String url) {