mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
WEB-33014 False "File is not a schema" error in json widget
This commit is contained in:
@@ -247,7 +247,18 @@ public class JsonSchemaServiceImpl implements JsonSchemaService {
|
||||
|
||||
@Override
|
||||
public boolean isSchemaFile(@NotNull VirtualFile file) {
|
||||
return myState.getFiles().contains(file) || hasSchemaSchema(file);
|
||||
return myState.getFiles().contains(file)
|
||||
|| isSchemaByProvider(file)
|
||||
|| hasSchemaSchema(file);
|
||||
}
|
||||
|
||||
private boolean isSchemaByProvider(@NotNull VirtualFile file) {
|
||||
JsonSchemaFileProvider provider = myState.getProvider(file);
|
||||
if (provider == null) return false;
|
||||
VirtualFile schemaFile = provider.getSchemaFile();
|
||||
if (schemaFile == null) return false;
|
||||
String url = schemaFile.getUrl();
|
||||
return url.startsWith("http://json-schema.org/") && url.endsWith("/schema");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user