Skip to content

Commit

Permalink
Bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Apr 17, 2024
1 parent 62d6061 commit 4cb376d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 27 deletions.
5 changes: 4 additions & 1 deletion server/src/docs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ use utoipa::OpenApi;
title = "enstate.rs",
description = "A hosted ENS API allowing for easy access to ENS data.",
),
paths(crate::routes::address::get, crate::routes::name::get, crate::routes::universal::get),
paths(
crate::routes::address::get, crate::routes::name::get, crate::routes::universal::get,
crate::routes::address::get_bulk, crate::routes::name::get_bulk, crate::routes::universal::get_bulk
),
components(schemas(ENSProfile, ListResponse<BulkResponse<ENSProfile>>, ErrorResponse))
)]
pub struct ApiDoc;
Expand Down
26 changes: 13 additions & 13 deletions server/src/routes/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ pub struct AddressGetBulkQuery {
fresh: FreshQuery,
}

// #[utoipa::path(
// get,
// path = "/bulk/a/",
// responses(
// (status = 200, description = "Successfully found address.", body = BulkResponse<ENSProfile>),
// (status = BAD_REQUEST, description = "Invalid address.", body = ErrorResponse),
// (status = NOT_FOUND, description = "No name was associated with this address.", body = ErrorResponse),
// (status = UNPROCESSABLE_ENTITY, description = "Reverse record not owned by this address.", body = ErrorResponse),
// ),
// params(
// ("addresses" = Vec<String>, Path, description = "Addresses to lookup name data for"),
// )
// )]
#[utoipa::path(
get,
path = "/bulk/a",
responses(
(status = 200, description = "Successfully found address.", body = BulkResponse<ENSProfile>),
(status = BAD_REQUEST, description = "Invalid address.", body = ErrorResponse),
(status = NOT_FOUND, description = "No name was associated with this address.", body = ErrorResponse),
(status = UNPROCESSABLE_ENTITY, description = "Reverse record not owned by this address.", body = ErrorResponse),
),
params(
("addresses" = Vec<String>, Path, description = "Addresses to lookup name data for"),
)
)]
pub async fn get_bulk(
Qs(query): Qs<AddressGetBulkQuery>,
State(state): State<Arc<crate::AppState>>,
Expand Down
2 changes: 1 addition & 1 deletion server/src/routes/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ pub struct NameGetBulkQuery {

#[utoipa::path(
get,
path = "/bulk/n/",
path = "/bulk/n",
responses(
(status = 200, description = "Successfully found name.", body = ListButWithLength<BulkResponse<Profile>>),
(status = NOT_FOUND, description = "No name could be found.", body = ErrorResponse),
Expand Down
24 changes: 12 additions & 12 deletions server/src/routes/universal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ pub struct UniversalGetBulkQuery {
fresh: FreshQuery,
}

// #[utoipa::path(
// get,
// path = "/bulk/u/",
// responses(
// (status = 200, description = "Successfully found name or address.", body = BulkResponse<ENSProfile>),
// (status = NOT_FOUND, description = "No name or address could be found.", body = ErrorResponse),
// (status = UNPROCESSABLE_ENTITY, description = "Reverse record not owned by this address.", body = ErrorResponse),
// ),
// params(
// ("name_or_address" = String, Path, description = "Name or address to lookup the name data for."),
// )
// )]
#[utoipa::path(
get,
path = "/bulk/u",
responses(
(status = 200, description = "Successfully found name or address.", body = BulkResponse<ENSProfile>),
(status = NOT_FOUND, description = "No name or address could be found.", body = ErrorResponse),
(status = UNPROCESSABLE_ENTITY, description = "Reverse record not owned by this address.", body = ErrorResponse),
),
params(
("name_or_address" = String, Path, description = "Name or address to lookup the name data for."),
)
)]
pub async fn get_bulk(
Qs(query): Qs<UniversalGetBulkQuery>,
State(state): State<Arc<crate::AppState>>,
Expand Down

0 comments on commit 4cb376d

Please sign in to comment.