pub enum Schema {
JsonSchema(Value),
SherpSchema(SherpSchema),
}Expand description
Unified schema that handles both formats
Variants§
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load schema from a file, auto-detecting format
Sourcepub fn from_json_schema(json: &str) -> Result<Self>
pub fn from_json_schema(json: &str) -> Result<Self>
Load from JSON Schema string
Sourcepub fn from_sherp_schema(yaml: &str) -> Result<Self>
pub fn from_sherp_schema(yaml: &str) -> Result<Self>
Load from simplified schema YAML string
Sourcepub fn to_json_schema(&self) -> JsonValue
pub fn to_json_schema(&self) -> JsonValue
Convert to JSON Schema for validation
Sourcepub fn extract_defaults(&self) -> JsonValue
pub fn extract_defaults(&self) -> JsonValue
Extract defaults from the schema
Sourcepub fn defaults_as_values(&self) -> Values
pub fn defaults_as_values(&self) -> Values
Get defaults as Values
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more