Skip to content

Commit

Permalink
editoast: bump axum from 0.7.9 to 0.8.1 in /editoast
Browse files Browse the repository at this point in the history
Bumps [axum](/~https://github.com/tokio-rs/axum) from 0.7.9 to 0.8.1.
- [Release notes](/~https://github.com/tokio-rs/axum/releases)
- [Changelog](/~https://github.com/tokio-rs/axum/blob/main/CHANGELOG.md)
- [Commits](/~https://github.com/tokio-rs/axum/commits)

---
updated-dependencies:
- dependency-name: axum
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
  • Loading branch information
dependabot[bot] authored and woshilapin committed Jan 10, 2025
1 parent 7e37c15 commit 86129e0
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 44 deletions.
89 changes: 70 additions & 19 deletions editoast/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions editoast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ uuid = { version = "1.11.0", features = ["serde", "v4"] }
[dependencies]
anyhow = "1.0"
async-trait = "0.1.84"
axum = { version = "0.7.9", default-features = false, features = [
axum = { version = "0.8.1", default-features = false, features = [
"multipart",
"tracing",
] }
axum-extra = { version = "0.9.6", default-features = false, features = [
axum-extra = { version = "0.10.0", default-features = false, features = [
"typed-header",
] }
axum-test = { version = "16.4.1", default-features = false }
axum-tracing-opentelemetry = { version = "0.24.1", default-features = false, features = [
axum-test = { version = "17.0.1", default-features = false }
axum-tracing-opentelemetry = { version = "0.25.0", default-features = false, features = [
"tracing_level_info",
] }
chrono.workspace = true
Expand Down Expand Up @@ -172,7 +172,11 @@ regex = "1.11.1"
reqwest.workspace = true
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
serde_qs = { version = "0.13.0", features = ["axum"] }
# official serde_qs seems unmaintained. Bump to `axum:0.8` is an opened PR waiting to be merged.
# /~https://github.com/samscott89/serde_qs/pull/118
serde_qs = { version = "0.13.0", git = "/~https://github.com/Atrox/serde_qs", rev = "2cfa3ee0", features = [
"axum",
] }
serde_yaml = "0.9.34"
sha1 = "0.10"
strum.workspace = true
Expand All @@ -198,7 +202,7 @@ validator = { version = "0.19.0", features = ["derive"] }

[dev-dependencies]
async-std = { version = "1.13.0", features = ["attributes", "tokio1"] }
axum = { version = "0.7.9", default-features = false, features = [
axum = { version = "0.8.1", default-features = false, features = [
"macros",
"multipart",
"tracing",
Expand Down
20 changes: 1 addition & 19 deletions editoast/src/views/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,6 @@ where
}
}

/// Reformats a service path defined in the OpenApi format to the Axum format
///
/// For path parameters, the OpenApi format uses curly braces, e.g. `/users/{id}`.
/// The Axum format uses a colon, e.g. `/users/:id`.
/// The `routes!` macro requires path parameters to be defined in the OpenApi format.
pub(in crate::views) fn format_axum_path_parameters(url_with_path_params: &str) -> String {
url_with_path_params
.split('/')
.map(|part| {
if part.starts_with('{') && part.ends_with('}') {
format!(":{}", &part[1..part.len() - 1])
} else {
part.to_string()
}
})
.join("/")
}

#[allow(unused)]
impl OpenApiPathScope {
pub fn new(prefix: Option<&'static str>) -> Self {
Expand Down Expand Up @@ -227,7 +209,7 @@ macro_rules! routes {
(@router [$router:expr] $prefix:literal => {$($tt:tt)+} , $($rest:tt)*) => {
$crate::routes!(@router
[$router.nest(
&$crate::views::openapi::format_axum_path_parameters($prefix),
&$prefix,
$crate::routes!(@router [axum::Router::<$crate::AppState>::new()] $($tt)+)
)]
$($rest)*
Expand Down

0 comments on commit 86129e0

Please sign in to comment.