Skip to content

Commit e56508f

Browse files
committed
Fix path params interfering across requests
1 parent cb04f06 commit e56508f

File tree

4 files changed

+21
-25
lines changed

4 files changed

+21
-25
lines changed

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 2.9.2 [14th October 2025]
2+
3+
### Fixed
4+
5+
- Fixed path parameters interference across requests.
6+
17
## 2.9.1 [24th September 2025]
28

39
### Fixed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "posting"
3-
version = "2.9.1"
3+
version = "2.9.2"
44
description = "The modern API client that lives in your terminal."
55
authors = [
66
{ name = "Darren Burns", email = "darrenb900@gmail.com" }

src/posting/app.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,17 +872,19 @@ def _sync_path_params_from_url(
872872
except NoMatches:
873873
table = None # type: ignore[assignment]
874874

875-
if table and table.row_count > 0:
876-
# Use current table order/values to preserve by index.
875+
if preferred_values is not None:
876+
# When preferred values are provided (e.g. loading a request),
877+
# map by name to ensure values follow their placeholders.
878+
for name in names:
879+
values_by_index.append(str(preferred_values.get(name, "")))
880+
elif table and table.row_count > 0:
881+
# Otherwise, when editing the current URL, preserve values by index
882+
# from the existing table rows.
877883
for row_index in range(table.row_count):
878884
row = table.get_row_at(row_index)
879885
cell = row[1]
880886
val = cell.plain if isinstance(cell, Text) else cell
881887
values_by_index.append(str(val))
882-
elif preferred_values:
883-
# Fall back to provided preferred values, preserving their given order.
884-
# Dicts preserve insertion order, which should correspond to saved order.
885-
values_by_index.extend(list(preferred_values.values()))
886888

887889
# Build new rows, mapping values by index.
888890
rows = [

uv.lock

Lines changed: 6 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)