Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .changepacks/changepack_log_MGs4qHAloZZkkK7utYPTq.json
Original file line number Diff line number Diff line change
@@ -0,0 +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"}
6 changes: 3 additions & 3 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion crates/vespera_macro/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub fn collect_metadata(folder_path: &Path, folder_name: &str) -> Result<Collect
} else {
format!("/{}", segments.join("/"))
};
let route_path = route_path.replace('_', "-");

metadata.routes.push(RouteMetadata {
method: route_info.method,
Expand Down Expand Up @@ -138,7 +139,7 @@ pub fn create_user() -> String {
1,
0,
"post",
"/create_user",
"/create-user",
"create_user",
"routes::create_user",
)]
Expand Down
8 changes: 4 additions & 4 deletions crates/vespera_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ pub fn create_user() -> String {
"#,
)],
"post",
"/create_user",
"/create-user",
"routes::create_user::create_user",
)]
#[case::single_put_route(
Expand All @@ -469,7 +469,7 @@ pub fn update_user() -> String {
"#,
)],
"put",
"/update_user",
"/update-user",
"routes::update_user::update_user",
)]
#[case::single_delete_route(
Expand All @@ -484,7 +484,7 @@ pub fn delete_user() -> String {
"#,
)],
"delete",
"/delete_user",
"/delete-user",
"routes::delete_user::delete_user",
)]
#[case::single_patch_route(
Expand All @@ -499,7 +499,7 @@ pub fn patch_user() -> String {
"#,
)],
"patch",
"/patch_user",
"/patch-user",
"routes::patch_user::patch_user",
)]
#[case::route_with_custom_path(
Expand Down
2 changes: 1 addition & 1 deletion examples/axum-example/src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub async fn mod_file_with_complex_struct_body_with_rename(
)
}

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