Merge pull request #508 from alexzautke/az-fix-extensions-on-pattern

Allow extensions in checkFixedValue if a pattern instead of a fixedValue is defined on the element
This commit is contained in:
Grahame Grieve 2021-05-31 08:39:18 +10:00 committed by GitHub
commit afe5c09f26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1843,7 +1843,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
List<Element> extensions = new ArrayList<Element>();
focus.getNamedChildren("extension", extensions);
if (fixed.getExtension().size() == 0) {
rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == 0, I18nConstants.EXTENSION_EXT_FIXED_BANNED);
rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == 0 || pattern == true, I18nConstants.EXTENSION_EXT_FIXED_BANNED);
} else if (rule(errors, IssueType.VALUE, focus.line(), focus.col(), path, extensions.size() == fixed.getExtension().size(), I18nConstants.EXTENSION_EXT_COUNT_MISMATCH, Integer.toString(fixed.getExtension().size()), Integer.toString(extensions.size()))) {
for (Extension e : fixed.getExtension()) {
Element ex = getExtensionByUrl(extensions, e.getUrl());