Skip to content

Commit c538a53

Browse files
Merge pull request #105 from devopsarr/feature/code-generation
fix(deps): update dependency sonarr/sonarr to v4.0.20.3014
2 parents 1ca282b + 35585c5 commit c538a53

3 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
55

66
- API version: v4.0.19.2979
77
- Package version: 1.1.1 <!--- x-release-please-version -->
8-
- Generator version: 7.25.0
8+
- Generator version: 7.26.0
99
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1010

1111
## Requirements.
1212

1313
Python 3.10+
1414

15+
Packaging uses standard `[project]` metadata and `[dependency-groups]` (PEP 621/735).
16+
Install the package with `python -m pip install .`; install development dependencies
17+
with Poetry 2.2 or newer using `poetry install`, or pip 25.1 or newer using
18+
`python -m pip install --group dev`. The latter installs the group, not the package.
19+
1520
## Installation & Usage
1621
### pip install
1722

@@ -496,4 +501,3 @@ Authentication schemes defined for the API:
496501

497502

498503

499-

‎pyproject.toml‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,15 @@ dependencies = [
2020
[project.urls]
2121
Repository = "https://github.com/devopsarr/sonarr-py"
2222

23-
[tool.poetry]
24-
requires-poetry = ">=2.0"
25-
26-
[tool.poetry.group.dev.dependencies]
27-
pytest = ">= 9.0.3"
28-
pytest-cov = ">= 2.8.1"
29-
tox = ">= 3.9.0"
30-
flake8 = ">= 4.0.0"
31-
types-python-dateutil = ">= 2.8.19.14"
32-
mypy = ">= 1.5"
23+
[dependency-groups]
24+
dev = [
25+
"pytest>=9.0.3",
26+
"pytest-cov>=2.8.1",
27+
"tox>=3.9.0",
28+
"flake8>=4.0.0",
29+
"types-python-dateutil>=2.8.19.14",
30+
"mypy>=1.5",
31+
]
3332

3433

3534
[build-system]

‎sonarr/api_client.py‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,13 @@ def parameters_to_tuples(self, params, collection_formats):
519519
new_params.append((k, v))
520520
return new_params
521521

522+
def explode_query_object(self, name, obj):
523+
"""form style, explode: one query parameter per entry, keyed by the property name; a list repeats the name, None is left out"""
524+
obj = self.sanitize_for_serialization(obj)
525+
if not isinstance(obj, dict):
526+
obj = {name: obj}
527+
return [(k, item) for k, v in obj.items() for item in (v if isinstance(v, (list, tuple)) else [v]) if item is not None]
528+
522529
def parameters_to_url_query(self, params, collection_formats):
523530
"""Get parameters as list of tuples, formatting collections.
524531
@@ -537,11 +544,12 @@ def parameters_to_url_query(self, params, collection_formats):
537544
if isinstance(v, dict):
538545
v = json.dumps(v)
539546

540-
if k in collection_formats:
547+
# a collection format applies only to a list; an exploded entry may share a declared array parameter's name
548+
if k in collection_formats and isinstance(v, (list, tuple)):
541549
collection_format = collection_formats[k]
542550
if collection_format == 'multi':
543551
new_params.extend(
544-
(k, quote(str(value).lower() if isinstance(value, bool) else str(value)))
552+
(quote(str(k)), quote(str(value).lower() if isinstance(value, bool) else str(value)))
545553
for value in v
546554
)
547555
else:
@@ -554,12 +562,13 @@ def parameters_to_url_query(self, params, collection_formats):
554562
else: # csv is the default
555563
delimiter = ','
556564
new_params.append(
557-
(k, delimiter.join(
565+
(quote(str(k)), delimiter.join(
558566
quote(str(value).lower() if isinstance(value, bool) else str(value))
559567
for value in v))
560568
)
561569
else:
562-
new_params.append((k, quote(str(v))))
570+
# names are quoted too: an exploded object's names are runtime data
571+
new_params.append((quote(str(k)), quote(str(v))))
563572

564573
return "&".join(["=".join(map(str, item)) for item in new_params])
565574

0 commit comments

Comments
 (0)