From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Stefan Hanreich <s.hanreich@proxmox.com>
Cc: pdm-devel@lists.proxmox.com
Subject: Re: [pdm-devel] [PATCH proxmox-api-types 1/1] generator: support methods with no parameters
Date: Wed, 5 Feb 2025 15:01:50 +0100 [thread overview]
Message-ID: <3hdesy7jeqeuptxee6hhpk2v6lz6ss3u4lnuqo7ntfd6in6s33@j5tlbva5ncqv> (raw)
In-Reply-To: <694d9487-6b6c-41e4-86d4-a765657d3480@proxmox.com>
On Wed, Feb 05, 2025 at 02:39:12PM +0100, Stefan Hanreich wrote:
> On 2/5/25 14:03, Wolfgang Bumiller wrote:
> > This would produce an explicit parameter of type `()` - why not just
> > drop `params` when we have none?
>
> I did it, because the http client's post method required a 'param'
> parameter for post calls, I didn't see that there's post_without_body
> available.
>
> We could try to catch this by checking if there is an input-type and, if
> not, generate the method with the `post_without_body` method of the http
> client instead?
>
> Alternatively, we could check in the print_implementation call and use
> `print_method_without_body` depending on the input-type / input defs?
I think making this distinction in `print_implementation` (and
`print_trait`) makes sense.
The client's methods are all now wrapping `.request()` - it *may* be
nicer to distinguish the cases *only* this way and use the
`$http_method` as the method parameter to the client's `.request()`
instead of mapping http methods to client wrapper methods... (But this
can be done later...)
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
prev parent reply other threads:[~2025-02-05 14:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 13:14 Stefan Hanreich
2025-02-05 13:03 ` Wolfgang Bumiller
2025-02-05 13:39 ` Stefan Hanreich
2025-02-05 14:01 ` Wolfgang Bumiller [this message]
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=3hdesy7jeqeuptxee6hhpk2v6lz6ss3u4lnuqo7ntfd6in6s33@j5tlbva5ncqv \
--to=w.bumiller@proxmox.com \
--cc=pdm-devel@lists.proxmox.com \
--cc=s.hanreich@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