Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assign the description to the request object in OpenAPI #886

Merged
merged 1 commit into from
Nov 25, 2024
Merged
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
4 changes: 4 additions & 0 deletions poem-openapi-derive/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,13 @@ fn generate_operation(
});

// request object meta
let param_desc = optional_literal(&param_description);
request_meta.push(quote! {
if <#arg_ty as #crate_name::ApiExtractor>::TYPES.contains(&#crate_name::ApiExtractorType::RequestObject) {
request = <#arg_ty as #crate_name::ApiExtractor>::request_meta();
if let Some(ref mut request) = request.as_mut() {
request.description = #param_desc;
}
}
});

Expand Down