From 2f19f0db15190651a9b9153ed52548f9a3d3fa71 Mon Sep 17 00:00:00 2001 From: Kirill Ivanov Date: Fri, 23 Aug 2024 12:40:03 +0300 Subject: [PATCH] apply changes to endpoint in server --- stats/Cargo.lock | 3 +-- stats/stats-server/Cargo.toml | 2 +- stats/stats-server/src/server.rs | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/stats/Cargo.lock b/stats/Cargo.lock index b45b33145..88017a08d 100644 --- a/stats/Cargo.lock +++ b/stats/Cargo.lock @@ -813,11 +813,10 @@ dependencies = [ [[package]] name = "blockscout-endpoint-swagger" version = "0.1.0" -source = "git+https://github.com/blockscout/blockscout-rs?rev=aea7256#aea7256324084782dc16135011f89807f8022603" +source = "git+https://github.com/blockscout/blockscout-rs?rev=7314b5d2#7314b5d2f57dbaef04167e0cd4973c2743727147" dependencies = [ "actix-files", "actix-web", - "prost-build", ] [[package]] diff --git a/stats/stats-server/Cargo.toml b/stats/stats-server/Cargo.toml index 21fda1520..9c825bd30 100644 --- a/stats/stats-server/Cargo.toml +++ b/stats/stats-server/Cargo.toml @@ -24,7 +24,7 @@ sea-orm = { version = "0.12", features = [ ] } tracing-subscriber = { version = "0.3", features = ["env-filter"] } blockscout-service-launcher = { workspace = true, features = [ "database-0_12" ] } -blockscout-endpoint-swagger = { git = "https://github.com/blockscout/blockscout-rs", rev = "aea7256" } +blockscout-endpoint-swagger = { git = "https://github.com/blockscout/blockscout-rs", rev = "7314b5d2" } cron = "0.12" convert_case = "0.6.0" itertools = "0.11.0" diff --git a/stats/stats-server/src/server.rs b/stats/stats-server/src/server.rs index 22f1e9147..d3a44706b 100644 --- a/stats/stats-server/src/server.rs +++ b/stats/stats-server/src/server.rs @@ -9,6 +9,7 @@ use crate::{ update_service::UpdateService, }; +use blockscout_endpoint_swagger::route_swagger; use blockscout_service_launcher::launcher::{self, LaunchSettings}; use sea_orm::{ConnectOptions, Database}; use stats_proto::blockscout::stats::v1::{ @@ -28,13 +29,12 @@ struct HttpRouter { impl launcher::HttpRouter for HttpRouter { fn register_routes(&self, service_config: &mut actix_web::web::ServiceConfig) { + let swagger_file_path = + std::path::PathBuf::from("../stats-proto/swagger/stats.swagger.yaml"); service_config .configure(|config| route_health(config, self.health.clone())) - .configure(|config| route_stats_service(config, self.stats.clone())); - blockscout_endpoint_swagger::register_route( - service_config, - std::path::PathBuf::from("../stats-proto/swagger/stats.swagger.yaml"), - ); + .configure(|config| route_stats_service(config, self.stats.clone())) + .configure(|config| route_swagger(config, swagger_file_path)); } }