Defect
Commands generated from an OpenAPI operation with requestBody.required: false still send a JSON null payload when their input omits body. That changes an absent body into a present invalid value.
The production dogfood command akua order-drafts create-worker-bootstrap --input - with only { "path": { "id": "..." } } received 422 Invalid input: expected object, received null, although the public contract marks its JSON body optional.
Reproduction
A local intercepted-transport run of the current CLI executor with the analogous optional-body machines.update operation and input { "path": { "id": "mch_capture" }, "headers": { "if-match": "0" } } captured:
PATCH https://api.akua.dev/v1/machines/mch_capture
Content-Type: application/json
body: null
No request reached production during this reproduction.
origin/main retains the same generated shape for orderDrafts.createWorkerBootstrap:
openapi/public.json declares requestBody.required: false.
src/generated/public-operation-executor.gen.ts maps omitted input.body to payload: undefined but still passes the payload field.
src/generated/openapi-api.gen.ts represents the request as [RequestJson, HttpApiSchema.NoContent].
- Effect HttpApiClient then encodes the
NoContent branch using its default JSON payload encoding, yielding null.
No existing akua-dev/cli issue matched optional bodies, null payloads, or NoContent.
Acceptance criteria
Scope
Fix the generic OpenAPI/Effect client generation or request serialization boundary; do not add a handwritten exception for worker bootstrap.
Defect
Commands generated from an OpenAPI operation with
requestBody.required: falsestill send a JSONnullpayload when their input omitsbody. That changes an absent body into a present invalid value.The production dogfood command
akua order-drafts create-worker-bootstrap --input -with only{ "path": { "id": "..." } }received422 Invalid input: expected object, received null, although the public contract marks its JSON body optional.Reproduction
A local intercepted-transport run of the current CLI executor with the analogous optional-body
machines.updateoperation and input{ "path": { "id": "mch_capture" }, "headers": { "if-match": "0" } }captured:No request reached production during this reproduction.
origin/mainretains the same generated shape fororderDrafts.createWorkerBootstrap:openapi/public.jsondeclaresrequestBody.required: false.src/generated/public-operation-executor.gen.tsmaps omittedinput.bodytopayload: undefinedbut still passes the payload field.src/generated/openapi-api.gen.tsrepresents the request as[RequestJson, HttpApiSchema.NoContent].NoContentbranch using its default JSON payload encoding, yieldingnull.No existing
akua-dev/cliissue matched optional bodies, null payloads, orNoContent.Acceptance criteria
bodyfor every optional JSON request body sends no request bytes and noContent-Typeheader.body: {}or an allowed populated object still sends the JSON object and validates it strictly.body: nullremains a client-side input validation error.orderDrafts.createWorkerBootstrap(including its colon-suffixed path) and one ordinary optional-body operation.Scope
Fix the generic OpenAPI/Effect client generation or request serialization boundary; do not add a handwritten exception for worker bootstrap.