Skip to content

Commit c6ffafd

Browse files
authored
Merge pull request #5 from golemcloud/operation_id_support
operationId support
2 parents 79ff401 + 8d30966 commit c6ffafd

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
@@ -497,8 +497,15 @@ fn trait_method(
497497
) -> Result<Method> {
498498
let (result_code, result_type) = method_result(&op.op.responses.responses, ref_cache)?;
499499

500+
let name =
501+
if let Some(op_id) = &op.op.operation_id {
502+
op_id.to_case(Case::Snake)
503+
} else {
504+
op.path.strip_prefix(prefix_length).method_name(&op.method)
505+
};
506+
500507
Ok(Method {
501-
name: op.path.strip_prefix(prefix_length).method_name(&op.method),
508+
name,
502509
path: op.path.clone(),
503510
original_path: op.original_path.clone(),
504511
http_method: op.method.to_string(),

0 commit comments

Comments
 (0)