Skip to content

@W-23748891 feat: render SSE text/event-stream body via shapes#itemSchema fallback - #63

Draft
alexpmule wants to merge 3 commits into
masterfrom
W-23748891-sse-itemschema
Draft

@W-23748891 feat: render SSE text/event-stream body via shapes#itemSchema fallback#63
alexpmule wants to merge 3 commits into
masterfrom
W-23748891-sse-itemschema

Conversation

@alexpmule

Copy link
Copy Markdown
Contributor

@W-23748891

What

Renders SSE (text/event-stream) response bodies via a shapes#itemSchema fallback.

OAS 3.1/3.2 describes the per-event payload of a streaming response through itemSchema rather than the usual body schema. This falls back to itemSchema when the media type is text/event-stream (or the standard schema is absent), so the streamed event payload renders instead of an empty body.

Why

TD-0333486 — OAS 3.1/3.2 support in API Console v6. AC3: SSE / streaming responses must render their event payload.

Tests

Green in chromium + firefox. Includes an inline AMF expanded-model fixture; the real-model variant this.skip()s when the generated fixture is absent (degrades to skip, never red).

Scope

Draft for review.

@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alex Perez <a***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

@alexpmule
alexpmule force-pushed the W-23748891-sse-itemschema branch from 1bedff3 to eb5d3d8 Compare August 18, 2026 22:18
alexpmule and others added 3 commits August 19, 2026 15:29
OAS 3.2 SSE responses carry the streamed event shape under
`shapes#itemSchema` rather than `shapes#schema`, so the body renderer
returned undefined and drew an empty body. `_computeSelectedSchema` now
falls back to `itemSchema` when `schema` is absent, building the key
from the shapes prefix (amf-helper-mixin has no `itemSchema` constant).
`_computeTypeName` also suppresses the internal `itemSchema` name so it
is not surfaced as a user-facing type title, matching `schema`.

Covers W-23748891 AC-01/02/03.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The inline-AMF suite (sse-item-schema.test.js) is the generator-independent
gating oracle and depends on no model file. The fixture-driven suite is the
supporting visual/e2e check; guard it so a stripped or partial checkout
without the committed console model degrades to `skip`, never a false red.
Also document the fixture provenance explicitly: the JSON is produced by the
console toolchain (api-model-generator 0.4.0 / AMF 5.11), not this component's
pinned generator, and committed like the existing grpc-test.json fixture.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The mixed [string, boolean] variant table inferred  as
, tripping tsc (lint:types) where loadModelOrSkip
expects a boolean. Annotate the table as Array<[string, boolean]>.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexpmule
alexpmule force-pushed the W-23748891-sse-itemschema branch from eb5d3d8 to 3050ff7 Compare August 19, 2026 18:30
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