cat_gateway/service/common/objects/config/
mod.rs1mod environment;
4pub(crate) mod frontend_config;
5mod version;
6
7use poem_openapi::{types::Example, Object};
8
9use crate::service::common;
10
11#[derive(Object)]
13#[oai(example = true)]
14pub(crate) struct ConfigUnprocessableContent {
15 error: common::types::generic::error_msg::ErrorMessage,
17 #[oai(default, skip_serializing_if_is_empty)]
19 schema_validation_errors: common::types::generic::error_list::ErrorList,
20}
21
22impl ConfigUnprocessableContent {
23 pub(crate) fn new(
25 error: String,
26 schema_validation_errors: Option<common::types::generic::error_list::ErrorList>,
27 ) -> Self {
28 Self {
29 error: error.into(),
30 schema_validation_errors: schema_validation_errors.unwrap_or_default(),
31 }
32 }
33}
34
35impl Example for ConfigUnprocessableContent {
36 fn example() -> Self {
37 Self {
38 error: "Invalid Data".to_string().into(),
39 schema_validation_errors: Example::example(),
40 }
41 }
42}