Add support for defining streams - #4513
Conversation
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
|
Azure/typespec-azure#1615 addresses the e2e test failures. |
Timothee Guerin (timotheeguerin)
left a comment
There was a problem hiding this comment.
I think just need to update the init templates to include @stream and maybe bring this up tomorrow in scrum to make sure we want to add this new dependency on http
| @@ -0,0 +1,42 @@ | |||
| --- | |||
There was a problem hiding this comment.
is this docs/libraries/stream/reference duplicate with docs/libraries/streams/reference?
|
Seems like the playground is not working here link I wonder if we should add those libraries into the playground? Also, the openapi3 output from my local is generating the response type as string, get:
operationId: subscribe
parameters: []
responses:
'200':
description: The request has succeeded.
content:
application/jsonl:
schema:
type: stringis this expected? If yes, how can we link the output type to the model |
| * } | ||
| * | ||
| * @TypeSpec.Events.events | ||
| * union ChannelEvents { |
There was a problem hiding this comment.
just curious if we should suggest TypeSpec author to use discriminated union if there's multiple event types? I think client side probably need to handle them differently?
| * usermessage: UserMessage, | ||
| * userdisconnect: UserDisconnect, | ||
| * | ||
| * @Events.contentType("text/plain") |
There was a problem hiding this comment.
I guess different event could have different content type? I wonder how can we get the context type for a specific event type?
| * Message, | ||
| * } | ||
| * | ||
| * op subscribe(): JsonlStream<Events>; |
There was a problem hiding this comment.
I am a little confused by the jsonlstream usage and the event usage, does jsonl stream necessarily mean it's an event based?
Related: #154