1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use apistos_models::paths::Response;
use apistos_models::reference_or::ReferenceOr;
use apistos_models::Schema;
use std::collections::BTreeMap;

pub trait ApiErrorComponent {
  fn schemas_by_status_code() -> BTreeMap<String, (String, ReferenceOr<Schema>)>;
  fn error_responses() -> Vec<(String, Response)>;
}

#[cfg(feature = "actix")]
impl ApiErrorComponent for actix_web::error::Error {
  fn schemas_by_status_code() -> BTreeMap<String, (String, ReferenceOr<Schema>)> {
    BTreeMap::default()
  }

  fn error_responses() -> Vec<(String, Response)> {
    vec![]
  }
}