Skip to main content

parse

Function parse 

Source
pub fn parse(bytes: &[u8]) -> Result<ShakrsConfig, ConfigParseError>
Expand description

Parse shakrs.json bytes into a validated ShakrsConfig.

Two passes: serde_json handles syntax and schema (deny_unknown_fields rejects unknown keys), then the garde semantic pass enforces the cross-field rules. Returns the first failure.

§Errors

Returns ConfigParseError::Schema when the bytes are not valid JSON or violate the schema, and ConfigParseError::Semantic when a garde rule fails (unsupported version, empty waiver reason, …).