What real-world OpenAPI specs look like, and what that means for Infusion. Five official specs, downloaded and measured on 2026-11-14.

OpenAIStripeGitHubCloudflareTwilio (api v2010)
OpenAPI3.1.03.0.03.0.33.0.33.0.1
Size4.3 MB (YAML)8.3 MB14.3 MB28.0 MB1.9 MB
Operations3886121,2813,778197
Schemas2,2721,5381,0157,152150
oneOf / anyOf / allOf449 / 1,298 / 169322 / 2,124 / 0277 / 40 / 87351 / 589 / 3,7050 / 0 / 0
Discriminators23506580
Nullable (3.0) / type arrays (3.1)7 / 3532,795 / 04,054 / 03,069 / 01,011 / 0
Enums1,7644,3993,8029,423180
Deprecated operations176383160
Streaming (SSE) operations150010
Multipart operations1810320
Request bodiesJSONform-encoded (611 of 612)JSONJSON (+ SCIM, text)form-encoded
Auth declared in the specbearerbasic, bearernoneAPI key header, bearerbasic
Paginationafter / before / limitstarting_after / ending_before / limitpage / per_page + Link header (214 ops)mixed: page/per_page, cursor, limit/offset, pageSizePageSize / Page / PageToken
Servers1111 + per path, with variables (https://{stream_id}.k2...)per path (120)
Vendor extensionsx-stainless-const, x-oaiMetax-expandableFields, x-resourceIdx-github, x-github-breaking-changesx-fern-sdk-group-name, x-fern-sdk-method-namex-twilio

Twilio publishes 61 separate specs, one per product; the table measures the largest. Anthropic no longer publishes a spec: the links in its SDK's .stats.yml all return 404.

What Infusion has to handle

Both OpenAPI 3.0 and 3.1. Four of five specs are 3.0 (nullable: true), OpenAI is 3.1 (type: [string, "null"]). Normalize both into one representation early.

Big specs, fast. Cloudflare is 28 MB with 3,778 operations and 7,152 schemas. Parsing, $ref resolution and generation must be measured on it, and YAML loading must not coerce values (a YAML loader turned example strings in OpenAI's spec into dates).

Unions without discriminators. Stripe has 2,124 anyOf and not one discriminator: its expandable fields are "an ID string, or the expanded object" (customer: "cus_123" vs customer: %Customer{}). Infusion must resolve unions by shape, not only by a tag.

allOf composition. Cloudflare uses 3,705 allOf: schemas built by merging others. They have to be flattened into one struct, with conflicts detected.

Form-encoded bodies. Stripe and Twilio send application/x-www-form-urlencoded, Stripe with nested bracket notation (metadata[order_id]=6735). The runtime needs a correct nested form encoder, not just JSON.

Auth is not always in the spec. GitHub declares no security schemes at all. Auth has to be configurable outside the spec.

Pagination is not in the spec. Five APIs, at least six styles: cursors named three different ways, page numbers, offsets, tokens, and GitHub's Link header. Cloudflare alone mixes four. Pagination is declared per API (and per operation where needed) in infusion.exs.

Per-path and templated servers. Twilio sets a host on each path; Cloudflare has hosts with variables. The generated code must pick the right base URL per operation and fill in server variables.

Deprecations. Cloudflare marks 316 operations deprecated. Generate them with @deprecated, so users get compiler warnings.

Vendor naming hints. Cloudflare's x-fern-sdk-group-name and x-fern-sdk-method-name (and Stainless hints in OpenAI's spec) say how the vendor's own SDKs name things. Reading them gives SDKs that match the official ones.