Skip to content

The SDK layer to the requirements ledger: auth, servers, HTTP, encoding - #3

Merged
rsaryev merged 18 commits into
mainfrom
sdk-http
Nov 26, 2026
Merged

rsaryev merged 18 commits into
mainfrom
sdk-http

Conversation

@rsaryev

@rsaryev rsaryev commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

What

The SDK layer is now held to the specifications it claims, statement by statement.

  • Ledger: OpenAPI 2.0 and RFC 6749, 6750, 7578, 7617 and 9110 pinned byte for byte; the SDK stage's rows re-decided (conformance/triage-3.md). 930 requirements in scope: 831 covered by tests, 99 lossy with a reason, 0 missing (conformance/MISSING.md).
  • Authentication: every scheme kind (apiKey header/query/cookie, bearer, basic, other IANA schemes, oauth2 and openIdConnect tokens), OAuth 2.0 client credentials done by the client (RFC 6749 4.4: cache, one request in flight, one renewal on 401), requirements as written (OR, AND, {}, [], operation over document), no credentials over http: but to loopback, schemes and security declared in flowapi-sdk.yml when the description has none, config check codes config.auth.*, the mock answers 401, the README lists every scheme with its env vars.
  • Servers and HTTP: server variables checked against enum, relative server URLs, RFC 9110 retries (idempotent methods only, unless x-should-retry or an idempotency key), idempotency keys, redirects by 15.4.
  • Bodies: the Encoding Object read from the description, WHATWG form bodies, Swagger 2.0 forms and collectionFormat in every location (core refactored first: 58 lines freed, outputs byte-identical).
  • Texts: readme.title, package.description, method names without their resource's words; every README example and api.md signature compiled against its client.

Checks

  • scripts/check passes; bun run check in npm/ passes (generate byte for byte as the Rust command).
  • O8: 489 calls of cases.json and the corpus (GitHub, Stripe, Cloudflare SDKs type-check), no difference; Rust O8: 261 calls, 51 style examples, 39 own, no difference.
  • Benchmarks within budgets; types output byte-identical to main on Stripe, GitHub and Cloudflare, time the same on an alternating A/B.

🤖 Generated with Claude Code

rsaryev and others added 18 commits November 26, 2026 16:39
… stage's scope decided

Pinned byte for byte: OpenAPI 2.0 and RFC 6749, 6750, 7578, 7617, 9110. The extractor
reads them (RFC text and RFCXML v3 readers), every id has a class again, and the rows
that said "Revisit at the SDK stage" are decided (conformance/triage-3.md). In scope
now 931 (was 555): 583 covered, 66 lossy, 282 missing, listed in conformance/MISSING.md
by the report binary.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t the resource's words

flowapi-sdk.yml gains readme.title, package.description and package.keywords. A drafted
method name drops the words it shares with its resource (GitHub's
actions.getActionsCacheRetentionLimitForEnterprise is getCacheRetentionLimitForEnterprise;
Stripe's names repeating a resource word go from 462 to 5), and both names of a collision
grow together. Every user-facing text of a generated SDK was read and fixed, and
tests/texts.mjs compiles each README block and api.md signature against the client and
refuses placeholders.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, idempotency keys, redirects

Closes 56 in-scope ids (OpenAPI 3.0/3.1/3.2 servers, all of RFC 9110's). Retries follow
RFC 9110 9.2.2: a non-idempotent request is retried only on x-should-retry: true or with
an idempotency key (defaults.idempotency_key, one random key per call), and maxRetries
defaults to 1. Redirects follow 15.4 (303 to GET, 307/308 keep the body, loops and
chains over 20 refused, cross-origin still refused). Server variables are checked
against their enum, relative server URLs resolve against descriptionURL, and URLs with
user info are refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…orm bodies, Swagger 2.0 forms

Closes 127 in-scope ids (OpenAPI 3.x Encoding and Media Type encoding, prefixEncoding,
itemEncoding, nesting, non-JSON data, header values; Swagger 2.0 parameters, items,
headers, operations, path items, extensions; RFC 7578). The operations table carries
each request body's encoding and the client passes it on. A form body written from its
content is WHATWG-encoded in the TypeScript and Rust runtimes; Swagger 2.0 formData
collectionFormat becomes a style. RFC 7578 4.8 is lossy (OpenAPI's encoding headers are
sent), and 32 Swagger 2.0 validation keywords the types do not enforce are lossy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	CHANGELOG.md
#	conformance/MISSING.md
#	conformance/REPORT.md
#	crates/flowapi-sdk/tests/repo/auth/.flowapi/lock.json
#	crates/flowapi-sdk/tests/repo/shop/.flowapi/lock.json
…ls, requirements, checks

Closes 97 in-scope ids (Swagger 2.0 and OpenAPI 3.x security schemes, OAuth flows,
security requirements, Appendix F; RFC 6749, 6750, 7617). The client sends apiKey,
bearer, basic and other IANA schemes, a caller's token, and does RFC 6749 4.4 client
credentials itself (cached, one request in flight, one renewal on 401); credentials go
only over https or to loopback. The config declares schemes and security a description
lacks; config check warns when an API has no auth at all; the mock answers 401 when an
operation's security is not met, and the generated tests send credentials per scheme.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… in the core

Eight behavior-neutral refactors (kept outputs byte-identical) take the core from 5,997
to 5,939 working lines; the feature brings it to 5,964. The core reads 2.0's csv, ssv,
tsv and pipes in path, query and header, multi in a query, and each nested items level
by its own collectionFormat; the TypeScript and Rust SDK writers write them. Closes
oas-2.0.parameter-object.collectionFormat and oas-2.0.items-object.collectionFormat.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	AGENTS.md
#	CHANGELOG.md
#	conformance/MISSING.md
#	conformance/REPORT.md
#	crates/flowapi-sdk/src/client/core/core.ts
#	crates/flowapi-sdk/src/client/core/platform.ts
#	crates/flowapi-sdk/src/client/entry.rs
#	crates/flowapi-sdk/src/draft.rs
#	crates/flowapi-sdk/src/lib.rs
#	crates/flowapi-sdk/src/model.rs
#	crates/flowapi-sdk/tests/client/auth/src/client.ts
#	crates/flowapi-sdk/tests/repo.rs
#	crates/flowapi-sdk/tests/repo/auth/.flowapi/lock.json
#	crates/flowapi-sdk/tests/repo/shop/.flowapi/lock.json
#	crates/flowapi-sdk/tests/table.rs
#	plugins/flowapi/skills/sdk/references/config.md
# Conflicts:
#	conformance/MISSING.md
#	conformance/REPORT.md
#	crates/flowapi-sdk/tests/repo/auth/.flowapi/lock.json
#	crates/flowapi-sdk/tests/repo/edge/.flowapi/lock.json
#	crates/flowapi-sdk/tests/repo/hosts/.flowapi/lock.json
#	crates/flowapi-sdk/tests/repo/shop/.flowapi/lock.json
…s text, TLS before a token, nested formData

oas-2.0.operation-object.schemes: a value outside http, https, ws, wss is a warning and is
not used. The README's retries section holds for every retries and idempotency_key value
(tests/texts.mjs checks it); the TLS rule is checked before a client-credentials token is
requested; Swagger 2.0 formData arrays of arrays take each level's collectionFormat; the
edge case states security: []. The ledger: 930 in scope, 831 covered, 99 lossy, 0 missing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…holds it

The core's operations model carries each urlencoded request body's encoding (a member
with style, explode or allowReserved as a query parameter of that style, else by its
contentType; Swagger 2.0 formData arrays by collectionFormat), so the Rust target reads
it from the Program as G9 wants. Rust O8: 261 calls of cases.json, 0 differ (18 did).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ints the core's warnings

The SDK layer takes a 2.0 form member's style, explode and nested levels from the core's
Media::encoding instead of reading collectionFormat itself (encoding/swagger.rs 104 -> 50
lines). generate, in the CLI and the wasm module, now prints the core's warnings as well as
its errors, as the types command does, so a bad formData collectionFormat is warned once,
naming the parameter as formData (tests/generate_warnings_cli.rs).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… --check's test by what it says

flowapi-sdk.wasm is 1,370 KB (490 KB gzipped) with every security scheme kind, client
credentials, servers, the Encoding Object, RFC 9110 retries and redirects and the README's
texts; the budget is that and about 5% room. The parity test of generate --check held a
literal that a config's own warnings now precede on both commands; the bytes stay held to
Rust's by Pair.generate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…config.auth.none shows; English plurals

A live run found the draft writing security: [] for a description with no security scheme,
which is the config's statement that the API takes no credential and silenced the warning
meant for exactly that case. The draft now writes the example commented and leaves security
unset; draft to check stays without errors. A resource that meets a model's name takes its
English plural (activity -> activities, address -> addresses). The sdk skill says how to
answer config.auth.none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The SDK layer held to the requirements ledger: every security scheme kind, OAuth 2.0 client
credentials, servers and their variables, RFC 9110 retries, idempotency keys and redirects,
the Encoding Object, Swagger 2.0 forms and collectionFormat, the README's texts. The npm
package, the crates and the agent plugin at 0.3.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rsaryev
rsaryev merged commit c31c449 into main Nov 26, 2026
1 check passed
@rsaryev
rsaryev deleted the sdk-http branch November 26, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant