diff --git a/README.md b/README.md index 6e5f0d19..beaa9307 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This project is licensed under the [MIT license][license]. If you have any problems or ideas, please don't hesitate to [open an issue][zino-issue]. For Chinese rustaceans, you can also follow our WeChat official account to cantact us: -![zino-web](https://foruda.gitee.com/images/1693469268337449782/f4089986_145641.png) +![zino-web](https://user-images.githubusercontent.com/3446306/265183253-90b4f8bb-33d2-4e14-b6e3-78da313e2e68.png) [`zino-core`]: https://github.com/photino/zino/tree/main/zino-core [`zino-derive`]: https://github.com/photino/zino/tree/main/zino-derive diff --git a/examples/actix-app/Cargo.toml b/examples/actix-app/Cargo.toml index fd35f04e..dd947396 100644 --- a/examples/actix-app/Cargo.toml +++ b/examples/actix-app/Cargo.toml @@ -18,12 +18,12 @@ features = ["derive"] [dependencies.zino] path = "../../zino" -version = "0.11.2" +version = "0.11.3" features = ["actix", "export-pdf"] [dependencies.zino-core] path = "../../zino-core" -version = "0.12.2" +version = "0.12.3" features = [ "connector", "connector-arrow", @@ -33,8 +33,8 @@ features = [ [dependencies.zino-derive] path = "../../zino-derive" -version = "0.9.2" +version = "0.9.3" [dependencies.zino-model] path = "../../zino-model" -version = "0.9.2" +version = "0.9.3" diff --git a/examples/axum-app/Cargo.toml b/examples/axum-app/Cargo.toml index b83dee42..b3cb21e6 100644 --- a/examples/axum-app/Cargo.toml +++ b/examples/axum-app/Cargo.toml @@ -18,12 +18,12 @@ features = ["derive"] [dependencies.zino] path = "../../zino" -version = "0.11.2" +version = "0.11.3" features = ["axum", "export-pdf"] [dependencies.zino-core] path = "../../zino-core" -version = "0.12.2" +version = "0.12.3" features = [ "connector", "connector-arrow", @@ -33,8 +33,8 @@ features = [ [dependencies.zino-derive] path = "../../zino-derive" -version = "0.9.2" +version = "0.9.3" [dependencies.zino-model] path = "../../zino-model" -version = "0.9.2" +version = "0.9.3" diff --git a/examples/dioxus-desktop/Cargo.toml b/examples/dioxus-desktop/Cargo.toml index 3257e071..aab0c348 100644 --- a/examples/dioxus-desktop/Cargo.toml +++ b/examples/dioxus-desktop/Cargo.toml @@ -17,14 +17,14 @@ features = ["derive"] [dependencies.zino] path = "../../zino" -version = "0.11.2" +version = "0.11.3" features = ["dioxus"] [dependencies.zino-core] path = "../../zino-core" -version = "0.12.2" +version = "0.12.3" features = ["orm-sqlite"] [dependencies.zino-model] path = "../../zino-model" -version = "0.9.2" +version = "0.9.3" diff --git a/zino-core/Cargo.toml b/zino-core/Cargo.toml index ed966046..28223c90 100644 --- a/zino-core/Cargo.toml +++ b/zino-core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zino-core" description = "Core types and traits for zino." -version = "0.12.2" +version = "0.12.3" rust-version = "1.72" edition = "2021" license = "MIT" diff --git a/zino-core/src/openapi/parser.rs b/zino-core/src/openapi/parser.rs index 97e8a6e5..f50f0fe5 100644 --- a/zino-core/src/openapi/parser.rs +++ b/zino-core/src/openapi/parser.rs @@ -33,7 +33,7 @@ pub(super) fn parse_operation(name: &str, path: &str, config: &Table) -> Operati let mut operation_builder = OperationBuilder::new() .tag(name) .response("default", Ref::from_response_name("default")) - .response("4XX", Ref::from_response_name("4XX")); + .response("error", Ref::from_response_name("4XX")); if let Some(tags) = config.get_str_array("tags") { let tags = tags.into_iter().map(|s| s.to_owned()).collect::>(); operation_builder = operation_builder.tags(Some(tags)); diff --git a/zino-derive/Cargo.toml b/zino-derive/Cargo.toml index 4f8ec729..c4827dca 100644 --- a/zino-derive/Cargo.toml +++ b/zino-derive/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zino-derive" description = "Derived traits for zino." -version = "0.9.2" +version = "0.9.3" rust-version = "1.72" edition = "2021" license = "MIT" @@ -21,5 +21,5 @@ syn = "2.0.29" [dependencies.zino-core] path = "../zino-core" -version = "0.12.2" +version = "0.12.3" features = ["orm"] diff --git a/zino-model/Cargo.toml b/zino-model/Cargo.toml index d42a6c43..55433752 100644 --- a/zino-model/Cargo.toml +++ b/zino-model/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zino-model" description = "Domain models for zino." -version = "0.9.2" +version = "0.9.3" rust-version = "1.72" edition = "2021" license = "MIT" @@ -38,9 +38,9 @@ features = ["derive"] [dependencies.zino-core] path = "../zino-core" -version = "0.12.2" +version = "0.12.3" features = ["orm"] [dependencies.zino-derive] path = "../zino-derive" -version = "0.9.2" +version = "0.9.3" diff --git a/zino/Cargo.toml b/zino/Cargo.toml index 344f99bf..b06d7016 100644 --- a/zino/Cargo.toml +++ b/zino/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zino" description = "Next-generation framework for composable applications in Rust." -version = "0.11.2" +version = "0.11.3" rust-version = "1.72" edition = "2021" license = "MIT" @@ -22,8 +22,6 @@ actix = [ "dep:actix-web", "dep:tracing-actix-web", "utoipa-rapidoc/actix-web", - "utoipa-redoc/actix-web", - "utoipa-swagger-ui/actix-web", "zino-core/runtime-tokio", ] axum = [ @@ -33,8 +31,6 @@ axum = [ "dep:tower", "dep:tower-http", "utoipa-rapidoc/axum", - "utoipa-redoc/axum", - "utoipa-swagger-ui/axum", "zino-core/runtime-tokio", ] dioxus = [ @@ -145,14 +141,6 @@ features = ["opentelemetry_0_20"] version = "0.1.0" optional = true -[dependencies.utoipa-redoc] -version = "0.1.0" -optional = true - -[dependencies.utoipa-swagger-ui] -version = "3.1.5" -optional = true - [dependencies.zino-core] path = "../zino-core" -version = "0.12.2" +version = "0.12.3" diff --git a/zino/src/application/actix_cluster.rs b/zino/src/application/actix_cluster.rs index a1948f26..6194c012 100644 --- a/zino/src/application/actix_cluster.rs +++ b/zino/src/application/actix_cluster.rs @@ -10,8 +10,6 @@ use actix_web::{ }; use std::path::PathBuf; use utoipa_rapidoc::RapiDoc; -use utoipa_redoc::{Redoc, Servable}; -use utoipa_swagger_ui::{Config, SwaggerUi}; use zino_core::{ application::Application, extension::TomlTableExt, @@ -95,25 +93,12 @@ impl Application for ActixCluster { let res = file.into_response(&req); Ok(ServiceResponse::new(req, res)) })); - let rapidoc = RapiDoc::new("/api-docs/openapi.json").path("/rapidoc"); - let redoc = Redoc::with_url("/redoc", Self::openapi()); - let swagger_config = Config::default() - .query_config_enabled(true) - .display_request_duration(true) - .show_extensions(true) - .show_common_extensions(true) - .request_snippets_enabled(true) - .with_credentials(true) - .persist_authorization(true); - let swagger = SwaggerUi::new("/swagger-ui/{_:.*}") - .url("/api-docs/openapi.json", Self::openapi()) - .config(swagger_config); + let rapidoc = RapiDoc::with_openapi("/api-docs/openapi.json", Self::openapi()) + .path("/rapidoc"); let mut app = App::new() .route("/", index_file_handler) .service(static_files) .service(rapidoc) - .service(redoc) - .service(swagger) .default_service(web::to(|req: Request| async { let res = Response::new(StatusCode::NOT_FOUND); ActixResponse::from(res).respond_to(&req.into()) diff --git a/zino/src/application/axum_cluster.rs b/zino/src/application/axum_cluster.rs index 78bd9b08..4167c586 100644 --- a/zino/src/application/axum_cluster.rs +++ b/zino/src/application/axum_cluster.rs @@ -22,8 +22,6 @@ use tower_http::{ services::{ServeDir, ServeFile}, }; use utoipa_rapidoc::RapiDoc; -use utoipa_redoc::{Redoc, Servable}; -use utoipa_swagger_ui::{Config, SwaggerUi}; use zino_core::{ application::Application, extension::TomlTableExt, @@ -103,27 +101,14 @@ impl Application for AxumCluster { let app_env = app_state.env(); let listeners = app_state.listeners(); let servers = listeners.iter().map(|listener| { - let rapidoc = RapiDoc::new("/api-docs/openapi.json").path("/rapidoc"); - let redoc = Redoc::with_url("/redoc", Self::openapi()); - let swagger_config = Config::default() - .query_config_enabled(true) - .display_request_duration(true) - .show_extensions(true) - .show_common_extensions(true) - .request_snippets_enabled(true) - .with_credentials(true) - .persist_authorization(true); - let swagger = SwaggerUi::new("/swagger-ui") - .url("/api-docs/openapi.json", Self::openapi()) - .config(swagger_config); + let rapidoc = RapiDoc::with_openapi("/api-docs/openapi.json", Self::openapi()) + .path("/rapidoc"); let mut app = Router::new() .route_service("/", serve_file.clone()) .nest_service("/public", serve_dir.clone()) .route("/sse", routing::get(endpoint::sse_handler)) .route("/websocket", routing::get(endpoint::websocket_handler)) - .merge(rapidoc) - .merge(redoc) - .merge(swagger); + .merge(rapidoc); for route in &routes { app = app.merge(route.clone()); }