use alloc::string::String;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum JsonDigestError {
#[error("Path must start with '.' but it's: {path}")]
InvalidPathStart {
path: String,
},
#[error("Unclosed bracket in path: {path}")]
UnclosedBracket {
path: String,
},
#[error("Json digest is currently implemented only for composite types")]
NonCompositeType,
#[error("{0}")]
Internal(String),
#[error("Json string to be digested must be normalized with Unicode NFKD")]
NonNormalizedInput,
#[error(transparent)]
Json(#[from] serde_json::Error),
}
pub type Result<T> = core::result::Result<T, JsonDigestError>;