Skip to content

Commit 71f0592

Browse files
committed
chore: sync from pve-openapi@466feb3
fix(sdk-gen): repair 16 generator bugs flagged by live SDK E2E suite
1 parent b791b8a commit 71f0592

658 files changed

Lines changed: 12539 additions & 156 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.github/workflows/python.yml
22
.gitignore
33
.gitlab-ci.yml
4+
.openapi-generator-ignore
45
.travis.yml
56
README.md
67
clientapi_pmg/__init__.py

clientapi_pmg/api/access_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ def _change_passsword_serialize(
296296
)
297297

298298
# set the HTTP header `Content-Type`
299+
# Only emit Content-Type when there's actually a body/form/file to send.
300+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
301+
# application/json ("malformed JSON string"); other Proxmox products are
302+
# equally fussy. An explicit `_content_type` override always wins.
299303
if _content_type:
300304
_header_params['Content-Type'] = _content_type
301-
else:
305+
elif _body_params is not None or _form_params or _files:
302306
_default_content_type = (
303307
self.api_client.select_header_content_type(
304308
[

clientapi_pmg/api/access_auth_realm_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,13 @@ def _create_auth_realm_serialize(
303303
)
304304

305305
# set the HTTP header `Content-Type`
306+
# Only emit Content-Type when there's actually a body/form/file to send.
307+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
308+
# application/json ("malformed JSON string"); other Proxmox products are
309+
# equally fussy. An explicit `_content_type` override always wins.
306310
if _content_type:
307311
_header_params['Content-Type'] = _content_type
308-
else:
312+
elif _body_params is not None or _form_params or _files:
309313
_default_content_type = (
310314
self.api_client.select_header_content_type(
311315
[
@@ -1450,9 +1454,13 @@ def _update_auth_realm_serialize(
14501454
)
14511455

14521456
# set the HTTP header `Content-Type`
1457+
# Only emit Content-Type when there's actually a body/form/file to send.
1458+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1459+
# application/json ("malformed JSON string"); other Proxmox products are
1460+
# equally fussy. An explicit `_content_type` override always wins.
14531461
if _content_type:
14541462
_header_params['Content-Type'] = _content_type
1455-
else:
1463+
elif _body_params is not None or _form_params or _files:
14561464
_default_content_type = (
14571465
self.api_client.select_header_content_type(
14581466
[

clientapi_pmg/api/access_oidc_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,13 @@ def _auth_url_serialize(
298298
)
299299

300300
# set the HTTP header `Content-Type`
301+
# Only emit Content-Type when there's actually a body/form/file to send.
302+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
303+
# application/json ("malformed JSON string"); other Proxmox products are
304+
# equally fussy. An explicit `_content_type` override always wins.
301305
if _content_type:
302306
_header_params['Content-Type'] = _content_type
303-
else:
307+
elif _body_params is not None or _form_params or _files:
304308
_default_content_type = (
305309
self.api_client.select_header_content_type(
306310
[
@@ -862,9 +866,13 @@ def _login_serialize(
862866
)
863867

864868
# set the HTTP header `Content-Type`
869+
# Only emit Content-Type when there's actually a body/form/file to send.
870+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
871+
# application/json ("malformed JSON string"); other Proxmox products are
872+
# equally fussy. An explicit `_content_type` override always wins.
865873
if _content_type:
866874
_header_params['Content-Type'] = _content_type
867-
else:
875+
elif _body_params is not None or _form_params or _files:
868876
_default_content_type = (
869877
self.api_client.select_header_content_type(
870878
[

clientapi_pmg/api/access_tfa_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,13 @@ def _add_tfa_entry_serialize(
319319
)
320320

321321
# set the HTTP header `Content-Type`
322+
# Only emit Content-Type when there's actually a body/form/file to send.
323+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
324+
# application/json ("malformed JSON string"); other Proxmox products are
325+
# equally fussy. An explicit `_content_type` override always wins.
322326
if _content_type:
323327
_header_params['Content-Type'] = _content_type
324-
else:
328+
elif _body_params is not None or _form_params or _files:
325329
_default_content_type = (
326330
self.api_client.select_header_content_type(
327331
[
@@ -1810,9 +1814,13 @@ def _update_tfa_entry_serialize(
18101814
)
18111815

18121816
# set the HTTP header `Content-Type`
1817+
# Only emit Content-Type when there's actually a body/form/file to send.
1818+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1819+
# application/json ("malformed JSON string"); other Proxmox products are
1820+
# equally fussy. An explicit `_content_type` override always wins.
18131821
if _content_type:
18141822
_header_params['Content-Type'] = _content_type
1815-
else:
1823+
elif _body_params is not None or _form_params or _files:
18161824
_default_content_type = (
18171825
self.api_client.select_header_content_type(
18181826
[

clientapi_pmg/api/access_ticket_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,13 @@ def _create_ticket_serialize(
296296
)
297297

298298
# set the HTTP header `Content-Type`
299+
# Only emit Content-Type when there's actually a body/form/file to send.
300+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
301+
# application/json ("malformed JSON string"); other Proxmox products are
302+
# equally fussy. An explicit `_content_type` override always wins.
299303
if _content_type:
300304
_header_params['Content-Type'] = _content_type
301-
else:
305+
elif _body_params is not None or _form_params or _files:
302306
_default_content_type = (
303307
self.api_client.select_header_content_type(
304308
[

clientapi_pmg/api/access_users_api.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,13 @@ def _create_users_serialize(
304304
)
305305

306306
# set the HTTP header `Content-Type`
307+
# Only emit Content-Type when there's actually a body/form/file to send.
308+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
309+
# application/json ("malformed JSON string"); other Proxmox products are
310+
# equally fussy. An explicit `_content_type` override always wins.
307311
if _content_type:
308312
_header_params['Content-Type'] = _content_type
309-
else:
313+
elif _body_params is not None or _form_params or _files:
310314
_default_content_type = (
311315
self.api_client.select_header_content_type(
312316
[
@@ -1738,9 +1742,13 @@ def _write_serialize(
17381742
)
17391743

17401744
# set the HTTP header `Content-Type`
1745+
# Only emit Content-Type when there's actually a body/form/file to send.
1746+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
1747+
# application/json ("malformed JSON string"); other Proxmox products are
1748+
# equally fussy. An explicit `_content_type` override always wins.
17411749
if _content_type:
17421750
_header_params['Content-Type'] = _content_type
1743-
else:
1751+
elif _body_params is not None or _form_params or _files:
17441752
_default_content_type = (
17451753
self.api_client.select_header_content_type(
17461754
[

clientapi_pmg/api/config_acme_api.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,13 @@ def _add_plugin_serialize(
585585
)
586586

587587
# set the HTTP header `Content-Type`
588+
# Only emit Content-Type when there's actually a body/form/file to send.
589+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
590+
# application/json ("malformed JSON string"); other Proxmox products are
591+
# equally fussy. An explicit `_content_type` override always wins.
588592
if _content_type:
589593
_header_params['Content-Type'] = _content_type
590-
else:
594+
elif _body_params is not None or _form_params or _files:
591595
_default_content_type = (
592596
self.api_client.select_header_content_type(
593597
[
@@ -3701,9 +3705,13 @@ def _register_account_serialize(
37013705
)
37023706

37033707
# set the HTTP header `Content-Type`
3708+
# Only emit Content-Type when there's actually a body/form/file to send.
3709+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
3710+
# application/json ("malformed JSON string"); other Proxmox products are
3711+
# equally fussy. An explicit `_content_type` override always wins.
37043712
if _content_type:
37053713
_header_params['Content-Type'] = _content_type
3706-
else:
3714+
elif _body_params is not None or _form_params or _files:
37073715
_default_content_type = (
37083716
self.api_client.select_header_content_type(
37093717
[
@@ -4014,9 +4022,13 @@ def _update_account_serialize(
40144022
)
40154023

40164024
# set the HTTP header `Content-Type`
4025+
# Only emit Content-Type when there's actually a body/form/file to send.
4026+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
4027+
# application/json ("malformed JSON string"); other Proxmox products are
4028+
# equally fussy. An explicit `_content_type` override always wins.
40174029
if _content_type:
40184030
_header_params['Content-Type'] = _content_type
4019-
else:
4031+
elif _body_params is not None or _form_params or _files:
40204032
_default_content_type = (
40214033
self.api_client.select_header_content_type(
40224034
[
@@ -4327,9 +4339,13 @@ def _update_plugin_serialize(
43274339
)
43284340

43294341
# set the HTTP header `Content-Type`
4342+
# Only emit Content-Type when there's actually a body/form/file to send.
4343+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
4344+
# application/json ("malformed JSON string"); other Proxmox products are
4345+
# equally fussy. An explicit `_content_type` override always wins.
43304346
if _content_type:
43314347
_header_params['Content-Type'] = _content_type
4332-
else:
4348+
elif _body_params is not None or _form_params or _files:
43334349
_default_content_type = (
43344350
self.api_client.select_header_content_type(
43354351
[

clientapi_pmg/api/config_admin_api.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,13 @@ def _update_admin_section_serialize(
566566
)
567567

568568
# set the HTTP header `Content-Type`
569+
# Only emit Content-Type when there's actually a body/form/file to send.
570+
# PVE/PMG Perl HTTP server rejects empty bodies with Content-Type:
571+
# application/json ("malformed JSON string"); other Proxmox products are
572+
# equally fussy. An explicit `_content_type` override always wins.
569573
if _content_type:
570574
_header_params['Content-Type'] = _content_type
571-
else:
575+
elif _body_params is not None or _form_params or _files:
572576
_default_content_type = (
573577
self.api_client.select_header_content_type(
574578
[

0 commit comments

Comments
 (0)