From 01368305de4fbbfcc7198bdf249eb91392495951 Mon Sep 17 00:00:00 2001 From: Alex Groleau Date: Thu, 18 Jun 2026 20:31:35 -0400 Subject: [PATCH] fixed missing schema ids in validation results --- src/tests/mod.rs | 10 ++++++++-- src/validator/mod.rs | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 977112a..d8d07b4 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -251,12 +251,18 @@ fn test_library_api() { { "code": "REQUIRED_FIELD_MISSING", "message": "Missing name", - "details": { "path": "name" } + "details": { + "path": "name", + "schema": "source_schema" + } }, { "code": "STRICT_PROPERTY_VIOLATION", "message": "Unexpected property 'wrong'", - "details": { "path": "wrong" } + "details": { + "path": "wrong", + "schema": "source_schema" + } } ] }) diff --git a/src/validator/mod.rs b/src/validator/mod.rs index 87b2efd..a338918 100644 --- a/src/validator/mod.rs +++ b/src/validator/mod.rs @@ -69,7 +69,7 @@ impl Validator { path: Some(e.path), cause: None, context: None, - schema: None, + schema: Some(schema_id.to_string()), }, }) .collect(); @@ -83,7 +83,7 @@ impl Validator { path: Some(e.path), cause: None, context: None, - schema: None, + schema: Some(schema_id.to_string()), }, }]), } @@ -95,7 +95,7 @@ impl Validator { path: Some("/".to_string()), cause: None, context: None, - schema: None, + schema: Some(schema_id.to_string()), }, }]) }