Skip to content

Made the stream-service requests take a required ref, listed first. - #302

Closed
moetemp wants to merge 1 commit into
mainfrom
moe/up/stream-ref-required
Closed

moetemp wants to merge 1 commit into
mainfrom
moe/up/stream-ref-required

Conversation

@moetemp

@moetemp moetemp commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR makes the stream ref required on each request of the stream-service sample, and lists each request's required fields first.

  • create-stream-request.ref, and %stream on the append, close, read and describe requests, are required. The generated create_stream takes ref as a required argument in Python, TypeScript and .NET.
  • records and topics come right after the stream. Once lists are required (Fix authored WIT collection optionality #300), the Python request dataclasses still need no kw_only.

Why?

A stream has no identity without its ref, so a create with no ref makes no sense. It came up in the review of the client target, and Tim suggested the field order on #300.

Flattening the ref into create_stream, so the caller passes id directly, is a separate question. @nexus.flatten-in-api doesn't work with resources in TypeScript and .NET yet.

How did you test it?

cargo validate passes.

@moetemp
moetemp requested a review from a team as a code owner October 27, 2026 04:37
@moetemp
moetemp marked this pull request as draft October 27, 2026 07:47
A stream has no identity without its ref, so each request takes it as a required field. The
required fields come first, so the generated Python dataclasses need no kw_only when lists
become required.
@moetemp
moetemp force-pushed the moe/up/stream-ref-required branch from f92d0c0 to cf4d780 Compare October 27, 2026 16:34
@moetemp moetemp changed the title Made the stream-service create take a required ref. Made the stream-service requests take a required ref, listed first. Oct 27, 2026
@moetemp

moetemp commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Closing this. #308 swaps the stream samples for Brook's real Stream service and writer WIT, which already make each request's %stream required and list the required fields first.

@moetemp moetemp closed this Oct 27, 2026
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