Skip to content

Fix nested JSON parameter normalization#25

Merged
adsharma merged 1 commit into
mainfrom
fix/nested-json-parameters
Jun 1, 2026
Merged

Fix nested JSON parameter normalization#25
adsharma merged 1 commit into
mainfrom
fix/nested-json-parameters

Conversation

@adsharma
Copy link
Copy Markdown
Contributor

Summary

Fix to_json($param) handling for Python JSON parameters that contain mixed scalar and nested values in the same list.

Root Cause

The JSON parameter normalization path only forced JSON serialization for empty or otherwise unresolved nested shapes. Lists like ["entry1", "entry2", {"key": "value"}] were treated as typed parameters even though their mixed scalar/object structure is a JSON shape.

Changes

  • Detect mixed scalar and nested list elements as requiring JSON serialization.
  • Add an integration regression for nested @context JSON data.
  • Add a normalization regression that ensures this path does not import NumPy for non-NumPy users.

Validation

  • uv run pytest test/test_json.py test/test_parameter.py test/test_issue.py::test_issue_483_numpy_ndarray_parameter -q
  • uvx ruff check src_py/connection.py test/test_json.py

@adsharma adsharma marked this pull request as ready for review May 30, 2026 22:43
@adsharma adsharma force-pushed the fix/nested-json-parameters branch from d9aff9c to 00d4371 Compare June 1, 2026 02:03
@adsharma adsharma merged commit 69295fd into main Jun 1, 2026
2 checks passed
@adsharma adsharma deleted the fix/nested-json-parameters branch June 1, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant