feat: better api docs (#6586)

* feat: docs

* fix tombi

* chore: fix some of the routes rendering with missing /

* response schemas

* fix: restore labrinth docs routes

* Fix path parameter docs in routes

* remove utoipa-actix-web

* consistency

* improve version intros

* improve formatting, examples

* better hash examples, move openapi stuff to openapi.rs

* more utoipa param fixes

* request body docs

* chore: remove moderation route from v2, remove ingest & webhooks from v3 spec

* fixes

* chore: tweak sources titles

* fix

* fix test

* improve examples

* increase compiler spawned thread stack size

* remove unused tests & script

* test

* bro what

* fix

---------

Co-authored-by: aecsocket <43144841+aecsocket@users.noreply.github.com>
This commit is contained in:
François-Xavier Talbot
2026-07-04 14:19:21 +00:00
committed by GitHub
co-authored by aecsocket
parent b26d048a63
commit 4a6fa9fc3d
103 changed files with 4546 additions and 1387 deletions
+5 -5
View File
@@ -7,7 +7,6 @@ use crate::env::ENV;
use actix_web::{App, dev::ServiceResponse, test};
use async_trait::async_trait;
use std::rc::Rc;
use utoipa_actix_web::AppExt;
pub mod project;
pub mod request_data;
@@ -25,12 +24,13 @@ pub struct ApiV2 {
impl ApiBuildable for ApiV2 {
async fn build(labrinth_config: LabrinthConfig) -> Self {
let app = App::new()
.into_utoipa_app()
.configure(|cfg| {
crate::utoipa_app_config(cfg, labrinth_config.clone())
crate::app_data_config(cfg, labrinth_config.clone())
})
.into_app()
.configure(|cfg| crate::app_config(cfg, labrinth_config.clone()));
.configure(|cfg| {
crate::app_routes_config(cfg, labrinth_config.clone())
})
.configure(crate::app_fallback_config);
let test_app: Rc<dyn LocalService> =
Rc::new(test::init_service(app).await);
+5 -5
View File
@@ -7,7 +7,6 @@ use crate::env::ENV;
use actix_web::{App, dev::ServiceResponse, test};
use async_trait::async_trait;
use std::rc::Rc;
use utoipa_actix_web::AppExt;
pub mod collections;
pub mod limits;
@@ -30,12 +29,13 @@ pub struct ApiV3 {
impl ApiBuildable for ApiV3 {
async fn build(labrinth_config: LabrinthConfig) -> Self {
let app = App::new()
.into_utoipa_app()
.configure(|cfg| {
crate::utoipa_app_config(cfg, labrinth_config.clone())
crate::app_data_config(cfg, labrinth_config.clone())
})
.into_app()
.configure(|cfg| crate::app_config(cfg, labrinth_config.clone()));
.configure(|cfg| {
crate::app_routes_config(cfg, labrinth_config.clone())
})
.configure(crate::app_fallback_config);
let test_app: Rc<dyn LocalService> =
Rc::new(test::init_service(app).await);