ocm_types/error.rs
1use serde::{Deserialize, Serialize};
2
3
4#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct Error {
7 /// An error message which is understandable for both humans and
8 /// machines (e.g. no use of special characters) providing more
9 /// information on the cause of the error.
10 /// example: RESOURCE_NOT_FOUND
11 pub message: String,
12 pub validation_errors: Vec<ValidationError>,
13}
14
15#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
16#[serde(rename_all = "camelCase")]
17pub struct ValidationError {
18 /// example: shareWith
19 pub name: Option<String>,
20 /// A validation error message which is understandable for
21 /// both humans and machines (e.g. no use of special
22 /// characters) providing more information on the cause of the
23 /// validation error.
24 /// example: NOT_FOUND
25 pub message: Option<String>,
26}