The check that stops unwrapBodyParam from clobbering a request body with a field called body reads schema.properties directly:
const schema = entry.requestBody[0]?.schema;
const properties = schema?.properties;
if (properties && typeof properties === "object" && "body" in properties) return params;
src/tools/execute-action.ts:49-51.
The generator inlines $refs but copies composition through untouched, so a field can be declared inside an allOf member instead. Two catalog entries already carry a root-level allOf (create_artifact, post_override_attestation), so the shape is in use.
What would go wrong: a regenerated catalog declares a field named body inside a composition branch. A caller sends params: { body: {...} } meaning that field. The check does not find it, unwraps anyway, and the object is flattened. Its inner keys go out as sibling top-level params and the body field never arrives. Nothing fails.
No catalog entry declares such a field today, so this is a forward risk rather than a live bug.
PR #63 added a bodyFields helper to test/catalog.test.ts that walks composition. Fixing this means moving that helper into src/ and having both callers use it, so one function decides what a request body declares.
Found while reviewing #63.
The check that stops
unwrapBodyParamfrom clobbering a request body with a field calledbodyreadsschema.propertiesdirectly:src/tools/execute-action.ts:49-51.The generator inlines
$refs but copies composition through untouched, so a field can be declared inside anallOfmember instead. Two catalog entries already carry a root-levelallOf(create_artifact,post_override_attestation), so the shape is in use.What would go wrong: a regenerated catalog declares a field named
bodyinside a composition branch. A caller sendsparams: { body: {...} }meaning that field. The check does not find it, unwraps anyway, and the object is flattened. Its inner keys go out as sibling top-level params and thebodyfield never arrives. Nothing fails.No catalog entry declares such a field today, so this is a forward risk rather than a live bug.
PR #63 added a
bodyFieldshelper totest/catalog.test.tsthat walks composition. Fixing this means moving that helper intosrc/and having both callers use it, so one function decides what a request body declares.Found while reviewing #63.