mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
move the swagger behind a feature flag
This commit is contained in:
parent
e579554c84
commit
21026f0ca8
2 changed files with 8 additions and 7 deletions
|
@ -19,7 +19,6 @@ use serde::{Deserialize, Serialize};
|
|||
use time::OffsetDateTime;
|
||||
use tracing::debug;
|
||||
use utoipa::{OpenApi, ToSchema};
|
||||
use utoipa_scalar::{Scalar, Servable as ScalarServable};
|
||||
|
||||
use self::api_key::KeyView;
|
||||
use self::indexes::documents::BrowseQuery;
|
||||
|
@ -102,11 +101,12 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
|
|||
.service(web::scope("/metrics").configure(metrics::configure))
|
||||
.service(web::scope("/experimental-features").configure(features::configure));
|
||||
|
||||
let now = std::time::Instant::now();
|
||||
let openapi = MeilisearchApi::openapi();
|
||||
println!("Took {:?} to generate the openapi file", now.elapsed());
|
||||
// #[cfg(feature = "webp")]
|
||||
cfg.service(Scalar::with_url("/scalar", openapi.clone()));
|
||||
#[cfg(feature = "swagger")]
|
||||
{
|
||||
use utoipa_scalar::{Scalar, Servable as ScalarServable};
|
||||
let openapi = MeilisearchApi::openapi();
|
||||
cfg.service(Scalar::with_url("/scalar", openapi.clone()));
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_task_id(req: &HttpRequest, opt: &Opt) -> Result<Option<TaskId>, ResponseError> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue