public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH proxmox-api-types 1/1] generator: support methods with no parameters
@ 2025-02-04 13:14 Stefan Hanreich
  2025-02-05 13:03 ` Wolfgang Bumiller
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Hanreich @ 2025-02-04 13:14 UTC (permalink / raw)
  To: pdm-devel

Some methods (e.g. 'PUT cluster/sdn') do not take any input
parameters. Support those methods by generating them with unit type as
type for the input parameters.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
 pve-api-types/generator-lib/Schema2Rust.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pve-api-types/generator-lib/Schema2Rust.pm b/pve-api-types/generator-lib/Schema2Rust.pm
index 068517e..554341d 100644
--- a/pve-api-types/generator-lib/Schema2Rust.pm
+++ b/pve-api-types/generator-lib/Schema2Rust.pm
@@ -535,7 +535,8 @@ my sub print_method_with_body : prototype($$$$$) {
         my ($arg, $def) = @$url_arg;
         print {$out} "    $arg: $def->{type},\n";
     }
-    print {$out} "    params: $def->{input_type},\n";
+    my $input = $def->{input_type} // '()';
+    print {$out} "    params: $input,\n";
     my $output = $def->{output_type} // '()';
     print {$out} ") -> Result<$output, Error> {\n";
     if ($trait) {
-- 
2.39.5


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-02-05 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-04 13:14 [pdm-devel] [PATCH proxmox-api-types 1/1] generator: support methods with no parameters Stefan Hanreich
2025-02-05 13:03 ` Wolfgang Bumiller
2025-02-05 13:39   ` Stefan Hanreich
2025-02-05 14:01     ` Wolfgang Bumiller

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