lix 0.12.0

Embeddable version control for apps and AI agents.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use serde_json::Value as JsonValue;

use crate::LixError;

pub(crate) fn validate_schema_amendment(
    previous: &JsonValue,
    next: &JsonValue,
) -> Result<(), LixError> {
    let previous = super::definition::parse_lix_schema(previous)?;
    let next = super::definition::parse_lix_schema(next)?;
    lix_schema::validate_amendment(&previous, &next).map_err(|error| {
        LixError::new(
            LixError::CODE_SCHEMA_DEFINITION,
            format!("incompatible schema amendment: {error}"),
        )
    })
}