@FunctionalInterface
public interface Validator
Model
and returns a list of ValidationEvent
.
A Validator
is used to enforce constraints on a model. This
interface is used to implement both built-in validation that runs on all
Smithy loaded models and custom validators that can be registered when
loading a model. Registering a Validator
class as a service
provider for the Validator
interface will cause the validator
to be applied each time a Model is built using a ModelAssembler
.
The ValidatorService
class is used to provide a service provider
for validators that can be configured in the Smithy model via the
validators[]
metadata.
ValidationEvent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MODEL_ERROR
Event ID used for structural errors encountered when loading a model.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ValidationEvent> |
validate(Model model)
Validates a model and returns a list of validation events.
|
static final java.lang.String MODEL_ERROR
java.util.List<ValidationEvent> validate(Model model)
model
- Model to validate.