Skip to main content

boundary_compiler/
schema.rs

1//! Optional JSON Schema validation before and after JCS canonicalization.
2//!
3//! This module provides a `SchemaValidator` that can validate JSON values
4//! against JSON Schema before and/or after canonicalization. It's designed
5//! for boundary profiles that require schema conformance as part of
6//! their transformation pipeline.
7//!
8//! Note: Schema validation is a stub in the base crate. For full JSON Schema
9//! support, enable the `jsonschema` feature.
10
11use crate::error::JcsError;
12
13/// JSON Schema validator companion to BoundaryProfile.
14///
15/// Currently a stub that always passes validation.
16/// For full JSON Schema support, use a dedicated validator crate.
17#[derive(Debug, Clone, Default)]
18pub struct SchemaValidator;
19
20impl SchemaValidator {
21    /// Creates a new validator (stub).
22    pub fn new() -> Self {
23        Self
24    }
25
26    /// Validates a value (stub — always returns Ok).
27    pub fn validate(&self, _value: &serde_json::Value) -> Result<(), JcsError> {
28        Ok(())
29    }
30}