Summary
Capabilities that declare optional {placeholder} headers fail when the optional arg is omitted: renderHeaders runs interpolate over every header value, and interpolate throws missing required argument: <name> on an absent placeholder. Body fields are optional-aware (a {placeholder} body field is dropped when absent unless listed in the schema required), but header rendering is not — so optional headers are de-facto mandatory.
Concretely this breaks amazon-bedrock model.invoke / model.converse, whose schemas mark accept / contentType optional but whose request declares headers: { accept: '{accept}', 'content-type': '{contentType}' }. Calling them without those args throws before the request is sent.
General declarative-REST behavior (not AWS-specific); surfaced during #113 / #118.
Evidence
src/connectors/adapters/declarative-rest.ts — renderHeaders maps each header through interpolate, which throws on a missing arg.
src/connectors/adapters/amazon-bedrock.ts — model.invoke request headers { accept: '{accept}', 'content-type': '{contentType}' }; required: ['modelId', 'body'].
Repro
amazonBedrockConnector.executeMutation({ capabilityName: 'model.invoke',
args: { modelId: 'anthropic.claude-3-sonnet-20240229-v1:0', body: {...} }, ... })
// → throws "missing required argument: accept"
Suggested fix
Make header interpolation optional-aware, mirroring renderObject for body fields: a header whose value is exactly {placeholder} is dropped when the arg is absent (unless the placeholder is in the capability's required list), instead of throwing.
Refs #113, #118.
Summary
Capabilities that declare optional
{placeholder}headers fail when the optional arg is omitted:renderHeadersrunsinterpolateover every header value, andinterpolatethrowsmissing required argument: <name>on an absent placeholder. Body fields are optional-aware (a{placeholder}body field is dropped when absent unless listed in the schemarequired), but header rendering is not — so optional headers are de-facto mandatory.Concretely this breaks
amazon-bedrockmodel.invoke/model.converse, whose schemas markaccept/contentTypeoptional but whose request declaresheaders: { accept: '{accept}', 'content-type': '{contentType}' }. Calling them without those args throws before the request is sent.General declarative-REST behavior (not AWS-specific); surfaced during #113 / #118.
Evidence
src/connectors/adapters/declarative-rest.ts—renderHeadersmaps each header throughinterpolate, which throws on a missing arg.src/connectors/adapters/amazon-bedrock.ts—model.invokerequest headers{ accept: '{accept}', 'content-type': '{contentType}' };required: ['modelId', 'body'].Repro
Suggested fix
Make header interpolation optional-aware, mirroring
renderObjectfor body fields: a header whose value is exactly{placeholder}is dropped when the arg is absent (unless the placeholder is in the capability'srequiredlist), instead of throwing.Refs #113, #118.