recourse 0.0.1-rc.3

Versioned failure contracts for Rust services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Generated schemas must fit the catalog artifact parser's resource profile.

use serde_json::Value;

use super::SchemaViolation;
use crate::{catalog::artifact::artifact_limits, wire::validate_value};

pub(super) fn validate(schema: &Value) -> Result<(), SchemaViolation> {
    validate_value(schema, artifact_limits()).map_err(|error| SchemaViolation {
        path: "$".to_owned(),
        reason: format!("schema exceeds catalog artifact limits: {error}"),
    })
}