platform/packages/json_god/lib/src/validation.dart

26 lines
553 B
Dart
Raw Normal View History

2021-03-07 15:56:09 +00:00
part of json_god;
/// Thrown when schema validation fails.
class JsonValidationError implements Exception {
//final Schema schema;
final invalidData;
final String cause;
const JsonValidationError(
String this.cause, this.invalidData);//, Schema this.schema);
}
/// Specifies a schema to validate a class with.
class WithSchema {
final Map schema;
const WithSchema(Map this.schema);
}
/// Specifies a schema to validate a class with.
class WithSchemaUrl {
final String schemaUrl;
const WithSchemaUrl(String this.schemaUrl);
}