Skip to content

Commit

Permalink
Add operation_id to lookup and healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
alisinabh committed May 9, 2024
1 parent ce9ab7f commit 7551874
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/services/healthcheck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use actix_web::{get, HttpResponse, Responder};
#[utoipa::path(
get,
path = "/health",
operation_id = "healthcheck",
tag = "Health",
responses(
(status = 200, description = "Ok", body = HealthCheckModel, content_type = "text/plain")
Expand Down
5 changes: 2 additions & 3 deletions src/services/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use std::net::IpAddr;
#[utoipa::path(
get,
path = "/geoip/lookup/{lookup_type}/{ip_addresses}",
operation_id = "lookup",
tag = "GeoIP",
responses(
(status = 200, description = "Ok", body = LookupResponseModel)
Expand Down Expand Up @@ -80,9 +81,7 @@ async fn handle(data: web::Data<MaxmindDB>, path: web::Path<(String, String)>) -
.map(|&ip| {
if ip.is_special_ip() {
Err(bad_request(
format!(
"IP Address is part of a special list and not allowed: {ip}"
),
format!("IP Address is part of a special list and not allowed: {ip}"),
"SPECIAL_IP".to_string(),
))
} else {
Expand Down

0 comments on commit 7551874

Please sign in to comment.