readSchemaFile static method
Reads the file at filePath
as a JsonSchema
Implementation
static JsonSchema readSchemaFile(String filePath, [FileCreator? creator]) {
final parser = FileParsers.jsonParser;
final schemaFile = File(filePath);
if (!schemaFile.existsSync() && creator != null) {
creator(file: schemaFile);
}
final schemaJson = Utils.readFile(file: schemaFile, parser: parser);
return JsonSchema.create(schemaJson);
}