apistos-core 0.6.0

Actix-web OpenAPI v3.0 documentation generator
Documentation
use crate::ApiComponent;
use actix_web::dev::Payload;
use actix_web::{HttpRequest, HttpResponse};
use apistos_models::Schema;
use apistos_models::reference_or::ReferenceOr;

macro_rules! empty_component_impl {
  ($($ty:ty),+) => {
    $(impl ApiComponent for $ty {
      fn child_schemas() -> Vec<(String, ReferenceOr<Schema>)> {
        vec![]
      }
      fn schema() -> Option<(String, ReferenceOr<Schema>)> {
        None
      }
    })+
  };
}

empty_component_impl!(HttpRequest, HttpResponse, Payload, ());

#[cfg(feature = "actix-web-grants")]
impl<T> ApiComponent for actix_web_grants::authorities::AuthDetails<T>
where
  T: Eq + std::hash::Hash,
{
  fn child_schemas() -> Vec<(String, ReferenceOr<Schema>)> {
    vec![]
  }
  fn schema() -> Option<(String, ReferenceOr<Schema>)> {
    None
  }
}