cat_gateway/service/common/objects/config/
mod.rspub(crate) mod frontend_config;
use poem_openapi::{types::Example, Object};
#[derive(Object, Default)]
#[oai(example = true)]
pub(crate) struct ConfigBadRequest {
#[oai(validator(max_length = "100", pattern = "^[0-9a-zA-Z].*$"))]
error: String,
#[oai(validator(max_items = "1000", max_length = "9999", pattern = "^[0-9a-zA-Z].*$"))]
schema_validation_errors: Option<Vec<String>>,
}
impl ConfigBadRequest {
pub(crate) fn new(error: String, schema_validation_errors: Option<Vec<String>>) -> Self {
Self {
error,
schema_validation_errors,
}
}
}
impl Example for ConfigBadRequest {
fn example() -> Self {
ConfigBadRequest {
error: "Invalid Data".to_string(),
schema_validation_errors: Some(vec!["Error message".to_string()]),
}
}
}