Expand description
JSON Schema validation for Codex Document Format files.
This module provides validation functions for the core CDX file types:
- Manifest (
manifest.json) - Content (
content/content.json) - Dublin Core metadata (
metadata/dublin-core.json)
§Feature Flag
This module requires the validation feature:
[dependencies]
cdx-core = { version = "0.1", features = ["validation"] }§Example
ⓘ
use cdx_core::validation::{validate_manifest, validate_content};
let manifest_json = r#"{"version": "0.1", "id": "sha256:abc..."}"#;
let errors = validate_manifest(manifest_json)?;
if errors.is_empty() {
println!("Manifest is valid");
} else {
for error in errors {
println!("Validation error: {}", error);
}
}Structs§
- Schema
Validation Error - JSON schema validation error for manifest and metadata files.
Functions§
- validate_
block_ index - Validate a block index JSON string against the schema.
- validate_
content - Validate a content JSON string against the CDX content schema.
- validate_
dublin_ core - Validate a Dublin Core metadata JSON string against the schema.
- validate_
manifest - Validate a manifest JSON string against the CDX manifest schema.
- validate_
signatures - Validate a signatures JSON string against the schema.
Type Aliases§
- Validation
Result - Result type for validation operations.