type.$ref to another file, relative to the document, is replaced by the referenced schema.$ref to a pointer in the same document is replaced by the referenced schema, whose type the rule then sees.$ref to a file that does not exist is reported as invalid-ref at severity error.$ref fails to resolve, a rule still sees the reference object.