Skip to content

Commit

Permalink
Release 0.12.3
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Sep 2, 2023
1 parent 045185e commit 3151817
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 68 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions examples/actix-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
8 changes: 4 additions & 4 deletions examples/axum-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
6 changes: 3 additions & 3 deletions examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion zino-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion zino-core/src/openapi/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();
operation_builder = operation_builder.tags(Some(tags));
Expand Down
4 changes: 2 additions & 2 deletions zino-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -21,5 +21,5 @@ syn = "2.0.29"

[dependencies.zino-core]
path = "../zino-core"
version = "0.12.2"
version = "0.12.3"
features = ["orm"]
6 changes: 3 additions & 3 deletions zino-model/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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"
16 changes: 2 additions & 14 deletions zino/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 = [
Expand All @@ -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 = [
Expand Down Expand Up @@ -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"
19 changes: 2 additions & 17 deletions zino/src/application/actix_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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())
Expand Down
21 changes: 3 additions & 18 deletions zino/src/application/axum_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 3151817

Please sign in to comment.