check type of target resource

This commit is contained in:
Grahame Grieve 2019-10-25 10:23:15 +11:00
parent 9b0324fb98
commit 5afc745424
2 changed files with 2 additions and 2 deletions

View File

@ -48,7 +48,7 @@ public interface IResourceValidator {
IGNORE, CHECK_TYPE_IF_EXISTS, CHECK_EXISTS, CHECK_EXISTS_AND_TYPE, CHECK_VALID;
public boolean checkExists() {
return this == CHECK_EXISTS_AND_TYPE || this == CHECK_EXISTS || this == CHECK_VALID;
return this == CHECK_EXISTS_AND_TYPE || this == CHECK_EXISTS || this == CHECK_VALID || this == CHECK_TYPE_IF_EXISTS;
}
public boolean checkType() {

View File

@ -1909,7 +1909,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
we = fetcher.fetch(hostContext.appContext, ref);
}
}
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, we != null, "Unable to resolve resource '"+ref+"'");
rule(errors, IssueType.STRUCTURE, element.line(), element.col(), path, we != null || pol == ReferenceValidationPolicy.CHECK_TYPE_IF_EXISTS, "Unable to resolve resource '"+ref+"'");
}
String ft;