public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH proxmox 1/2] pve-api-types: generator lib: add method to get return schema of api
Date: Mon,  1 Dec 2025 16:00:13 +0100	[thread overview]
Message-ID: <20251201150058.3461083-1-d.csapak@proxmox.com> (raw)

this can be useful to manually modify some parts of the return schema

Signed-off-by: Dominik Csapak <d.csapak@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



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


             reply	other threads:[~2025-12-01 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 15:00 Dominik Csapak [this message]
2025-12-01 15:00 ` [pdm-devel] [PATCH proxmox 2/2] fix #7080: pve-api-types: mark 'has-dbus-vmstate' optional Dominik Csapak
2025-12-01 15:02 ` [pdm-devel] [PATCH proxmox 1/2] pve-api-types: generator lib: add method to get return schema of api Dominik Csapak
2025-12-01 23:10 ` [pdm-devel] applied: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251201150058.3461083-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal