org.schemarepo
Interface Validator
public interface Validator
A Validator may be bound to each Subject in a Repository
to ensure that schemas added to the Subject are mutually compatible.
There are many useful notions of compatibility, for example:
Forwards Compatible: A user of any old schema
is able to read data written with the new schema
Backwards Compatible: A user of the most recent schema
is able to read data written with any older schema
Full Compatibility: A user of any schema
is able to read data written in any other schema
N+1 Compatibility: Forward compatibility constrained to
only the version one prior to the current version.
e.g. a reader with the second most recent schema
is able to read data written with the most recent schema
N+1 Compatibility: Backward compatibility constrained to
only the version one prior to the current version.
e.g. a reader with the most recent schema
is able to read data written with the second most recent schema
validate
void validate(String schemaToValidate,
Iterable<SchemaEntry> schemasInOrder)
throws SchemaValidationException
- Validate that a schema is compatible with the schemas provided.
- Parameters:
schemaToValidate - The schema to validate.schemasInOrder - The schemas to validate against,
presented in order from latest to oldest.
- Throws:
SchemaValidationException - if schemaToValidate is not compatible with the schemas
in schemasInOrder
Copyright © 2015. All rights reserved.