Skip to content

Commit 8d30966

Browse files
committed
operationId support
1 parent c60d5ba commit 8d30966

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/rust/client_gen.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,15 @@ fn trait_method(
483483
) -> Result<Method> {
484484
let (result_code, result_type) = method_result(&op.op.responses.responses, ref_cache)?;
485485

486+
let name =
487+
if let Some(op_id) = &op.op.operation_id {
488+
op_id.to_case(Case::Snake)
489+
} else {
490+
op.path.strip_prefix(prefix_length).method_name(&op.method)
491+
};
492+
486493
Ok(Method {
487-
name: op.path.strip_prefix(prefix_length).method_name(&op.method),
494+
name,
488495
path: op.path.clone(),
489496
original_path: op.original_path.clone(),
490497
http_method: op.method.to_string(),

0 commit comments

Comments
 (0)