JsonSchemaObject (final @NotNull JsonSchemaObject schema, final @NotNull JsonSchemaVariantsTreeBuilder.SchemaUrlSplitter splitter, @NotNull JsonSchemaService service) { final String path = splitter.getRelativePath(); if (StringUtil.isEmptyOrSpaces(path)) { final String id = splitter.getSchemaId(); if (isSelfReference(id)) { return schema; } if (id != null && id.startsWith("#") ) { final String resolvedId = schema.resolveId(id); if (resolvedId == null || id.equals("#" + resolvedId)) return null; return findRelativeDefinition(schema, new JsonSchemaVariantsTreeBuilder.SchemaUrlSplitter("#" + resolvedId), service); } return schema; } final JsonSchemaObject definition = schema.findRelativeDefinition(path); if (definition == null) { VirtualFile schemaFile = service.resolveSchemaFile(schema); LOG.debug(String.format("Definition not found by reference: '%s' in file %s", path, schemaFile == null ? "(no file)" : schemaFile.getPath())); } return definition; }