Skip to content

Commit

Permalink
Add to the operation the summary/documentation of the handler (#2298)
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper authored Nov 14, 2024
1 parent 41dd0be commit 2eb2f5b
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions crates/types/src/schema/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ impl ServiceOpenAPI {

let call_item = PathItem::builder()
.summary(Some(format!("Call {service_name}/{handler_name}")))
.description(Some(
handler_schemas
.documentation
.as_ref()
.cloned()
.unwrap_or_else(|| {
format!(
"Call {service_name} handler {handler_name} and wait for response"
)
}),
))
.operation(
HttpMethod::Post,
Operation::builder()
.operation_id(Some(operation_id.clone()))
.description(Some(
handler_schemas
.documentation
.as_ref()
.cloned()
.unwrap_or_else(|| {
format!(
"Call {service_name} handler {handler_name} and wait for response"
)
}),
))
.parameters(Some(parameters.clone()))
.tag(service_name.to_string())
.request_body(request_body.clone())
Expand All @@ -75,19 +75,19 @@ impl ServiceOpenAPI {

let send_item = PathItem::builder()
.summary(Some(format!("Send to {service_name}/{handler_name}")))
.description(Some(
handler_schemas
.documentation
.as_ref()
.cloned()
.unwrap_or_else(|| {
format!("Send request to {service_name} handler {handler_name}")
}),
))
.operation(
HttpMethod::Post,
Operation::builder()
.operation_id(Some(format!("{operation_id}-send")))
.description(Some(
handler_schemas
.documentation
.as_ref()
.cloned()
.unwrap_or_else(|| {
format!("Send request to {service_name} handler {handler_name}")
}),
))
.parameters(Some(parameters.clone()))
.parameter(parameters_ref(DELAY_PARAMETER_REF_NAME))
.tag(service_name.to_string())
Expand Down

0 comments on commit 2eb2f5b

Please sign in to comment.