Skip to content

Fix generated client mixed request bodies#26

Merged
Volv-G merged 1 commit into
TangleML:masterfrom
Volv-G:piforge/tangle-cli-codegen-update/fix-openapi-codegen-mixed-body-b46d867
Jul 10, 2026
Merged

Fix generated client mixed request bodies#26
Volv-G merged 1 commit into
TangleML:masterfrom
Volv-G:piforge/tangle-cli-codegen-update/fix-openapi-codegen-mixed-body-b46d867

Conversation

@Volv-G

@Volv-G Volv-G commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix the OpenAPI generated Python client so request bodies with both simple scalar fields and complex/object fields are lossless.
  • Always expose the generic body escape hatch for generated methods with request bodies, then merge it with named simple fields.
  • Bump patch versions for both packages: tangle-cli to 0.1.2 and tangle-api to 0.1.1.

Root cause

The generator only emitted named parameters for simple request-body fields and suppressed the generic body parameter whenever any simple body field existed. For mixed request bodies, complex/object fields were silently dropped. This affected required fields such as pipeline_task_spec on the pipeline-schedule endpoints and root_folder on component-library create/update.

Fix

Generated client methods now mirror the CLI transport semantics:

  • body is available for every request-body operation.
  • Request JSON uses body as the base payload.
  • Named simple fields are merged on top, so explicit method arguments override duplicate body keys.

Verification

  • uv run pytest tests/test_codegen.py -q → 29 passed
  • uv run pytest tests/test_packaging.py tests/test_codegen.py -q → 39 passed
  • uv run pytest -q → 626 passed, 4 warnings
  • Regenerated against /tmp/oasis_openapi.json and smoke-checked schedules_post_pipelines / schedules_patch_pipelines; both can carry pipeline_task_spec via body, while named scalar fields override duplicate body keys.

Follow-up

The downstream discovery-side update is intentionally separate: bump the submodule, rerun generate-tangle-api.sh, and delete the manual client.py wrappers.

Assisted-By: devx/ab04ee6e-8d31-4580-9a88-93ad2a8b42e8
@Volv-G Volv-G requested a review from Ark-kun as a code owner July 9, 2026 23:29
@Volv-G Volv-G merged commit 45a6ef2 into TangleML:master Jul 10, 2026
1 check passed
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