mirror of
https://github.com/modrinth/code.git
synced 2026-09-05 06:19:11 +00:00
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:
co-authored by
aecsocket
parent
b26d048a63
commit
4a6fa9fc3d
@@ -75,8 +75,9 @@ pub struct InitialVersionData {
|
||||
}
|
||||
|
||||
// under `/api/v1/version`
|
||||
/// Create a version on an existing project.
|
||||
/// Create a version on an existing project.
|
||||
#[utoipa::path(
|
||||
tag = "version creation",
|
||||
post,
|
||||
operation_id = "createVersion",
|
||||
request_body(
|
||||
@@ -84,7 +85,7 @@ pub struct InitialVersionData {
|
||||
description = "Multipart payload containing `data` and uploaded files"
|
||||
),
|
||||
responses(
|
||||
(status = 200, description = "Expected response to a valid request"),
|
||||
(status = 200, description = "Expected response to a valid request", body = LegacyVersion),
|
||||
(status = 400, description = "Request was invalid, see given error"),
|
||||
(
|
||||
status = 401,
|
||||
@@ -302,17 +303,20 @@ async fn get_example_version_fields(
|
||||
}
|
||||
|
||||
// under /api/v1/version/{version_id}
|
||||
/// Add files to an existing version.
|
||||
/// Add files to an existing version.
|
||||
#[utoipa::path(
|
||||
tag = "version creation",
|
||||
post,
|
||||
operation_id = "addFilesToVersion",
|
||||
params(("version_id" = VersionId, Path, description = "The ID of the version")),
|
||||
params(
|
||||
("version_id" = VersionId, Path, description = "The ID of the version")
|
||||
),
|
||||
request_body(
|
||||
content(("multipart/form-data")),
|
||||
description = "Multipart payload containing files to upload"
|
||||
),
|
||||
responses(
|
||||
(status = 204, description = "Expected response to a valid request"),
|
||||
(status = NO_CONTENT, description = "Expected response to a valid request"),
|
||||
(
|
||||
status = 401,
|
||||
description = "Incorrect token scopes or no authorization to access the requested item(s)"
|
||||
|
||||
Reference in New Issue
Block a user