[pdm-devel] [PATCH proxmox-api-types 1/1] generator: support methods with no parameters
Wolfgang Bumiller
w.bumiller at proxmox.com
Wed Feb 5 15:01:50 CET 2025
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...)
More information about the pdm-devel
mailing list