What happens
In sendly-sdk@1.0.0, dist/index.d.ts types an attachment's disposition as required:
attachments?: {
filename: string
content: string
contentType?: string
disposition: "attachment" | "inline" // <- not optional
}[]
So this does not compile:
await sendly.emails.send({
to: 'someone@example.com',
from: 'us@example.com',
subject: 'Report',
body: '<p>Attached.</p>',
attachments: [{ filename: 'report.pdf', content: base64 }],
})
// Property 'disposition' is missing in type '{ filename: string; content: string; }'
Why it is wrong
The OpenAPI schema declares default: "attachment" for that property, and it is not in the schema's required list. The API supplies the value; TypeScript should not force the caller to.
This is the usual openapi-typescript behaviour for a property carrying a default — the generator treats the default as a guarantee about the response shape and emits it as required on the request shape too. It is a generator artifact, not an intentional API constraint.
Suggested fix
The curated alias layer already solves exactly this elsewhere — PartialKeys<> is applied to CampaignV1Create.type and ListSubscribe.allowResubscribe. Extending it to the attachment item's disposition is a one-line change and needs no regeneration:
export type SendEmailV1Attachment = PartialKeys<
NonNullable<components['schemas']['SendEmailV1']['attachments']>[number],
'disposition'
>
It may be worth auditing the rest of the generated surface for other properties that carry a spec default and came out required for the same reason.
Context
Found while migrating a production app onto Sendly (transactional email, three services). Verified against the published sendly-sdk@1.0.0 tarball and https://api.sendly.now/api/openapi.json on 2026-09-03.
What happens
In
sendly-sdk@1.0.0,dist/index.d.tstypes an attachment'sdispositionas required:So this does not compile:
Why it is wrong
The OpenAPI schema declares
default: "attachment"for that property, and it is not in the schema'srequiredlist. The API supplies the value; TypeScript should not force the caller to.This is the usual
openapi-typescriptbehaviour for a property carrying adefault— the generator treats the default as a guarantee about the response shape and emits it as required on the request shape too. It is a generator artifact, not an intentional API constraint.Suggested fix
The curated alias layer already solves exactly this elsewhere —
PartialKeys<>is applied toCampaignV1Create.typeandListSubscribe.allowResubscribe. Extending it to the attachment item'sdispositionis a one-line change and needs no regeneration:It may be worth auditing the rest of the generated surface for other properties that carry a spec
defaultand came out required for the same reason.Context
Found while migrating a production app onto Sendly (transactional email, three services). Verified against the published
sendly-sdk@1.0.0tarball andhttps://api.sendly.now/api/openapi.jsonon 2026-09-03.