use actix_web::{HttpRequest, HttpResponse, get, web};
use web::Data;
use crate::AppState;
use super::debug_route_handler_auth_gate::authorize_debug_schema_request;
use super::debug_route_handler_output_handoff_assembly::build_debug_schema_handler_response;
#[get("/debug/schema")]
pub(super) async fn debug_schema(req: HttpRequest, app_state: Data<AppState>) -> HttpResponse {
if let Err(resp) = authorize_debug_schema_request(&req, app_state.get_ref()).await {
return resp;
}
build_debug_schema_handler_response(app_state.get_ref()).await
}