artifacts/models/
validation_error.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct ValidationError {
7    #[serde(rename = "loc")]
8    pub loc: Vec<models::ValidationErrorLocInner>,
9    #[serde(rename = "msg")]
10    pub msg: String,
11    #[serde(rename = "type")]
12    pub r#type: String,
13}
14
15impl ValidationError {
16    pub fn new(
17        loc: Vec<models::ValidationErrorLocInner>,
18        msg: String,
19        r#type: String,
20    ) -> ValidationError {
21        ValidationError { loc, msg, r#type }
22    }
23}