Skip to content

Commit

Permalink
[#124] path_param name 옵션 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Aug 25, 2024
1 parent c450415 commit f5509a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions rupring_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,19 @@ pub fn derive_rupring_doc(item: TokenStream) -> TokenStream {
}
}
"path_param" | "param" => {
if let Some(Expr::Lit(lit)) = &meta_value {
let mut text = lit.to_token_stream().to_string();

if text.starts_with("\"") {
text = text
.trim_start_matches("\"")
.trim_end_matches("\"")
.to_string();
}

field_name = text;
}

is_path_parameter = true;
}
"query" => {
Expand Down

0 comments on commit f5509a9

Please sign in to comment.