Skip to content

emit the dart http_rest client beside the typescript half - #285

Merged
eburgos merged 1 commit into
masterfrom
dart-http-rest-client
Sep 6, 2026
Merged

emit the dart http_rest client beside the typescript half#285
eburgos merged 1 commit into
masterfrom
dart-http-rest-client

Conversation

@eburgos

@eburgos eburgos commented Sep 6, 2026

Copy link
Copy Markdown
Owner

The Dart sibling of the TypeScript http client, emitted by dart_http_client() under the dart feature. One abstract transport interface per service over Dart 3 records — no HTTP package named (asserted). Methods build path/query/headers through the shared HttpShape/ScalarKind judgements, decode by status (ok_status, error_status, the 422 default binding, fixed fault codes through the already-generated fault class), and answer in Dart idiom: replies return success and throw the typed error; one-way returns void and throws a refusal — a deliberate, documented departure from TypeScript's result envelope. Bytes operations return the byte list + content type; the body-kind matches are exhaustive so a future streamed variant fails compile here rather than silently missing.

16 string-level tests cover the seam shape, building, every decode branch, defaults, header read-back, one-way, and bytes.

Gate: just lint, just test-named-features, cargo test --all-features green on the tree merged with master.

Every service publishes dart_http_client(): an abstract transport
interface over Dart 3 records (the interface is the only per-service
name), and a client whose methods build path, query and headers
through the shared http shape, decode by status, and answer in Dart's
own idiom - a reply operation returns its success and throws the
typed error, a one-way operation returns void and throws a refusal -
rather than transplanting the TypeScript result envelope. Faults
reuse the fault class and kind enum the dart backend already
publishes. No outbound validation is emitted: a Dart message is a
real class whose required constructor arguments cannot express the
malformed value the other languages guard against.

Bytes operations answer the byte list with its content type, read
bare. There is no streamed arm to forget: the body-kind matches are
exhaustive, so the compiler revisits this file when that variant
lands.
@eburgos
eburgos merged commit 4412edd into master Sep 6, 2026
@eburgos
eburgos deleted the dart-http-rest-client branch September 6, 2026 01:17
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