Skip to content

feat: describe a streamed response's items with itemSchema - #9

Open
maxholman[bot] wants to merge 1 commit into
masterfrom
feat/item-schema
Open

maxholman[bot] wants to merge 1 commit into
masterfrom
feat/item-schema

Conversation

@maxholman

@maxholman maxholman Bot commented Sep 26, 2026

Copy link
Copy Markdown

A media type now takes either schema or itemSchema. itemSchema is OpenAPI 3.2's schema for each item of a sequential media type, such as text/event-stream, application/jsonl or application/json-seq.

content: { contentType: "text/event-stream", itemSchema: tickEvent }
  • Api accepts openapi: "3.2.0".
  • The operation, path, request body, response and media type objects are typed against oas32, which 3.1 documents also satisfy. Schema stays on oas31.
  • New fixture: a 3.2 API with an SSE item schema (event const, data as a JSON string via contentMediaType + contentSchema). It's snapshotted and validated against the OAS 3.2 schema-base.

This is the first step toward typed stream items: openapi-codegen reads itemSchema next, and block65/rest-client#23 carries the item type on stream().

A media type takes either schema or itemSchema, OpenAPI 3.2's schema for
each item of a sequential type such as text/event-stream. Api accepts
openapi 3.2.0, and the operation, path and content objects are typed
against oas32, which 3.1 documents also satisfy. Schema stays on oas31.

Co-Authored-By: LLM <noreply@block65.dev>
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.

0 participants