[pdm-devel] [PATCH proxmox 1/2] pve-api-types: generator lib: add method to get return schema of api
Dominik Csapak
d.csapak at proxmox.com
Mon Dec 1 16:00:13 CET 2025
this can be useful to manually modify some parts of the return schema
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
pve-api-types/generator-lib/Schema2Rust.pm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/pve-api-types/generator-lib/Schema2Rust.pm b/pve-api-types/generator-lib/Schema2Rust.pm
index fe3c4ff1..208b0596 100644
--- a/pve-api-types/generator-lib/Schema2Rust.pm
+++ b/pve-api-types/generator-lib/Schema2Rust.pm
@@ -1881,6 +1881,14 @@ sub api : prototype($$$;%) {
create_method($api_url, $method, $rust_method_name, %extra);
}
+# Get the return schema of a method to manipulate it.
+sub get_return_type : prototype($$) {
+ my ($method, $api_url) = @_;
+
+ (undef, $method) = walk_api($method, $api_url);
+ return $method->{returns};
+}
+
# Fills $ALL_PATHS recursively from an api node.
my sub collect_paths : prototype($$);
sub collect_paths : prototype($$) {
--
2.47.3
More information about the pdm-devel
mailing list