Skip to content

Commit 09881fa

Browse files
committed
controllers/version/metadata: Move get_version_authors() to dedicated module
1 parent 3bb07a7 commit 09881fa

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

src/controllers/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
pub mod authors;
12
pub mod dependencies;
23
pub mod downloads;
34
pub mod metadata;

src/controllers/version/authors.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
use crate::controllers::version::CrateVersionPath;
2+
use axum_extra::json;
3+
use axum_extra::response::ErasedJson;
4+
5+
/// Get crate version authors.
6+
///
7+
/// This endpoint was deprecated by [RFC #3052](https://github.com/rust-lang/rfcs/pull/3052)
8+
/// and returns an empty list for backwards compatibility reasons.
9+
#[utoipa::path(
10+
get,
11+
path = "/api/v1/crates/{name}/{version}/authors",
12+
params(CrateVersionPath),
13+
tag = "versions",
14+
responses((status = 200, description = "Successful Response")),
15+
)]
16+
#[deprecated]
17+
pub async fn get_version_authors() -> ErasedJson {
18+
json!({
19+
"users": [],
20+
"meta": { "names": [] },
21+
})
22+
}

src/controllers/version/metadata.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,6 @@ pub struct VersionUpdateRequest {
3838
version: VersionUpdate,
3939
}
4040

41-
/// Get crate version authors.
42-
///
43-
/// This endpoint was deprecated by [RFC #3052](https://github.com/rust-lang/rfcs/pull/3052)
44-
/// and returns an empty list for backwards compatibility reasons.
45-
#[utoipa::path(
46-
get,
47-
path = "/api/v1/crates/{name}/{version}/authors",
48-
params(CrateVersionPath),
49-
tag = "versions",
50-
responses((status = 200, description = "Successful Response")),
51-
)]
52-
#[deprecated]
53-
pub async fn get_version_authors() -> ErasedJson {
54-
json!({
55-
"users": [],
56-
"meta": { "names": [] },
57-
})
58-
}
59-
6041
/// Get crate version metadata.
6142
#[utoipa::path(
6243
get,

src/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn build_axum_router(state: AppState) -> Router<()> {
4040
.routes(routes!(version::readme::get_version_readme))
4141
.routes(routes!(version::dependencies::get_version_dependencies))
4242
.routes(routes!(version::downloads::get_version_downloads))
43-
.routes(routes!(version::metadata::get_version_authors))
43+
.routes(routes!(version::authors::get_version_authors))
4444
.routes(routes!(krate::downloads::get_crate_downloads))
4545
.routes(routes!(krate::versions::list_versions))
4646
.routes(routes!(

0 commit comments

Comments
 (0)