1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! # Postmortem
//!
//! A validation library that accumulates ALL validation errors, providing
//! comprehensive feedback rather than short-circuiting on the first failure.
//!
//! ## Overview
//!
//! Unlike typical validation libraries that stop at the first error, postmortem
//! collects all validation errors to give users complete information about what
//! needs to be fixed. This is achieved through integration with stillwater's
//! `Validation` type for applicative error accumulation.
//!
//! ## Core Types
//!
//! - [`JsonPath`]: Represents paths to values in nested structures (e.g., `users[0].email`)
//! - [`SchemaError`]: A single validation error with context (path, message, expected/got values)
//! - [`SchemaErrors`]: A non-empty collection of validation errors
//! - [`Schema`]: Entry point for creating validation schemas
//!
//! ## Example
//!
//! ```rust
//! use postmortem::{JsonPath, Schema};
//! use serde_json::json;
//!
//! // Create a string schema with constraints
//! let schema = Schema::string()
//! .min_len(1)
//! .max_len(100);
//!
//! // Validate a value
//! let result = schema.validate(&json!("hello"), &JsonPath::root());
//! assert!(result.is_success());
//!
//! // Invalid values produce detailed errors
//! let result = schema.validate(&json!(""), &JsonPath::root());
//! assert!(result.is_failure());
//! ```
pub use ;
pub use ToJsonSchema;
pub use ;
pub use ;
pub use ;
/// Type alias for validation results using SchemaErrors
pub type ValidationResult<T> = Validation;