Skip to main content

validate

Function validate 

Source
pub fn validate<T: Validate>(value: T) -> Result<T, ValidationErrors>
Expand description

Validate a programmatically created value.

This is intended for use in testing custom validation rules, so you can create a Rust value and just run the validator.

In the real world, configurations should be deserialized with crate::parse_yaml, and validation will be done by the apollo-configuration crate.

We also recommend using YAML configurations in tests as much as possible, to make sure that you’re testing configurations that your users can actually write.