private static @Nullable String fetchSchemaUrl(@Nullable PsiFile psiFile) {
    if (psiFile == null) return null;
    if (psiFile instanceof JsonFile) {
      String url = JsonSchemaFileValuesIndex.readTopLevelProps(psiFile.getFileType(), psiFile.getText()).get(URL_CACHE_KEY);
      return url == null || JsonSchemaFileValuesIndex.NULL.equals(url) ? null : url;
    }
    else {
      JsonLikePsiWalker walker = JsonLikePsiWalker.getWalker(psiFile, JsonSchemaObjectReadingUtils.NULL_OBJ);
      if (walker != null) {
        Collection<PsiElement> roots = walker.getRoots(psiFile);
        for (PsiElement root : ObjectUtils.notNull(roots, List.<PsiElement>of())) {
          JsonValueAdapter adapter = walker.createValueAdapter(root);
          JsonObjectValueAdapter object = adapter != null ? adapter.getAsObject() : null;
          if (object != null) {
            List<JsonPropertyAdapter> list = object.getPropertyList();
            for (JsonPropertyAdapter propertyAdapter : list) {
              if (JsonSchemaFileValuesIndex.SCHEMA_PROPERTY_NAME.equals(propertyAdapter.getName())) {
                Collection<JsonValueAdapter> values = propertyAdapter.getValues();
                if (values.size() == 1) {
                  JsonValueAdapter item = ContainerUtil.getFirstItem(values);
                  if (item.isStringLiteral()) {
                    return StringUtil.unquoteString(item.getDelegate().getText());
                  }
                }
              }
            }
          }
        }
      }
    }
    return null;
  }
private static @Nullable String fetchSchemaUrl(@Nullable PsiFile psiFile)