Skip to content

Commit d503ff1

Browse files
committed
Convert hyphen path
1 parent 9774c7a commit d503ff1

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"changes":{"crates/vespera_core/Cargo.toml":"Patch","crates/vespera_macro/Cargo.toml":"Patch","crates/vespera/Cargo.toml":"Patch"},"note":"Convert hyphen path","date":"2025-12-04T09:55:33.920740600Z"}

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/vespera_macro/src/collector.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub fn collect_metadata(folder_path: &Path, folder_name: &str) -> Result<Collect
5959
} else {
6060
format!("/{}", segments.join("/"))
6161
};
62+
let route_path = route_path.replace('_', "-");
6263

6364
metadata.routes.push(RouteMetadata {
6465
method: route_info.method,

examples/axum-example/src/routes/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ pub async fn mod_file_with_complex_struct_body_with_rename(
138138
)
139139
}
140140

141-
#[vespera::route(get, path = "/test-struct")]
141+
#[vespera::route(get, path = "/test_struct")]
142142
pub async fn mod_file_with_test_struct(Query(query): Query<TestStruct>) -> Json<TestStruct> {
143143
Json(query)
144144
}

0 commit comments

Comments
 (0)