MCPcopy Create free account
hub / github.com/apache/avro-rs / validate

Method validate

avro/src/validator.rs:150–157  ·  view source on GitHub ↗

Validates a schema namespace. Should return [`Details::InvalidNamespace`] if it is invalid.

(&self, namespace: &str)

Source from the content-addressed store, hash-verified

148 ///
149 /// Should return [`Details::InvalidNamespace`] if it is invalid.
150 fn validate(&self, namespace: &str) -> AvroResult<()> {
151 let regex = SchemaNamespaceValidator::regex(self);
152 if !regex.is_match(namespace) {
153 Err(Details::InvalidNamespace(namespace.to_string(), regex.as_str()).into())
154 } else {
155 Ok(())
156 }
157 }
158}
159
160impl SchemaNamespaceValidator for SpecificationValidator {}

Callers

nothing calls this directly

Implementers 2

validator.rsavro/src/validator.rs
validators.rsavro/tests/validators.rs

Calls

no outgoing calls

Tested by

no test coverage detected