From f464b8dbfc029253954ad98f23a7e0e8dce427e9 Mon Sep 17 00:00:00 2001 From: Dmitry Dygalo Date: Sun, 15 Dec 2024 23:49:27 +0100 Subject: [PATCH] docs: Fix docstring for validate Signed-off-by: Dmitry Dygalo --- CHANGELOG.md | 4 ++++ crates/jsonschema/src/validator.rs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fe5b51d..744c9d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Documentation + +- Fix documentation for `validate` + ## [0.26.1] - 2024-10-29 ### Fixed diff --git a/crates/jsonschema/src/validator.rs b/crates/jsonschema/src/validator.rs index 4bb7a8e0..71155fe2 100644 --- a/crates/jsonschema/src/validator.rs +++ b/crates/jsonschema/src/validator.rs @@ -193,7 +193,7 @@ impl Validator { pub fn new(schema: &Value) -> Result> { Self::options().build(schema) } - /// Run validation against `instance` and return an iterator over [`ValidationError`] in the error case. + /// Validate `instance` against `schema` and return the first error if any. #[inline] pub fn validate<'i>(&self, instance: &'i Value) -> Result<(), ValidationError<'i>> { self.root.validate(instance, &LazyLocation::new())