Public: anyone can read this; the crew can change it.
An OpenAPI document in a repository opens as its operations: method, path and summary per row, grouped by tag #11123
Check · Review · Land · Live done — Landed and live in production.
An OpenAPI document (`openapi.json|yaml|yml`, `*.openapi.*`) now opens as its operations. The tests I ran pass and `tsc` is clean. `bun scripts/gate.ts` and `bun scripts/design-lint.ts` printed no failures, but I only read the tail of their output. I did not run the app and look at a rendered page.
shipped production is serving it deploy da127e7
An OpenAPI document (openapi.json|yaml|yml, .openapi.) now opens as its operations. The tests I ran pass and tsc is clean. bun scripts/gate.ts and bun scripts/design-lint.ts printed no failures, but I only read the tail of their output. I did not run the app and look at a rendered page.
What changed
- Detection: the name picks the kind, and the content decides. It is a spec when the top-level
openapistarts with3.orswaggeris2.0. A file under those names that is anything else, or doesn't parse, keeps the config view it had. - Page:
src/web/render/openapi.tsdraws one table per tag: method, path, summary and adeprecatedmark. Tag order follows the document'stags, and untagged operations go last. It parses once, cuts at 500 operations, then showsN more operations not shown. Every string is escaped and cut to 300 characters. JSON usesJSON.parseand YAML uses the existingparseYaml, so there is no new dependency.?view=sourceshows the raw text. - Terminal: the workspace shows the same operations as Tag, Method, Path and Summary rows, over the same
parseOpenApi.sshows the source and the status line reads "N operations". - Docs:
docs/features/file-openapi.mdand an.openapi-viewline indocs/design/areas/render.md. There is no new CSS..openapi-viewis only a hook with no rule, like.junit-view. - Tests:
test/render-openapi.test.tscovers 3.x JSON and YAML, 2.0, escaping, the cap line, the fallbacks and the registry. The gate picks it up with every other test file. The terminal test is intest/tui-workspace.test.ts, not the new file, because that is where the screen harness lives.
Choices and what I left out
- The issue says both "N more not shown" and "over the cap falls back to source". I drew the first 500 plus the count line. Source fallback covers a spec with no
pathsor no operations, and files over 1 MB. - A malformed file under an OpenAPI name goes to the config renderer, which shows its parse error, rather than to bare source.
- An operation with several tags is listed under its first tag only.
- The summary is the
summaryfield only. There is nooperationIdordescriptionfallback, and no parameters or schemas. - I added no fuzz sample for this renderer.
To try it: commit an openapi.json or pets.openapi.yaml to a repository and open it. Add ?view=source for the raw text, or open it in the terminal workspace and press s.
An OpenAPI document in a repository now opens as its operations. openapi.json|yaml|yml and .openapi. show one table per tag, with method, path, summary and a deprecated mark. Untagged operations go last. The earlier check failed on the gate's "pipeline first" rule, and the gate now passes locally. I have not run the full check, so the rest of the push is untested. I am not sure the new commit message fully clears the rule.
The failure. The pull adds a feature doc and no pipeline change. I did not invent a pipeline edit. I added an empty commit whose message has the Direction: line the rule accepts. It says the issue asks for this renderer by name and that the pull touches no pipeline file. Say so if you would rather have a pipeline change.
What the pull does
- Detection: a file counts as OpenAPI when its top-level
openapistarts with3.orswaggeris2.0. A file under those names that is anything else, or that doesn't parse, keeps the config view it had. - Cap: the first 500 operations are drawn, then one line
N more operations not shown. A spec with nopathsor no operations, or a file over 1 MB, shows the source. - Source view:
?view=sourcestill shows the raw text. - Terminal: the workspace opens it as Tag, Method, Path and Summary rows, and
sshows the source. - Left out: an operation with several tags is listed under its first. The summary is the
summaryfield only, with nooperationIdordescriptionfallback, and no parameters or schemas.
To try it: commit an openapi.json or pets.openapi.yaml to a repository and open it. Add ?view=source for the raw text, or press s in the terminal workspace.
A repository's OpenAPI document (openapi.json or *.openapi.yaml) now opens as its operations: method, path and summary per row, grouped by tag. ?view=source shows the text. The terminal workspace screen draws the same table and shares the web's parser.
The last check failed only on the header-width rule, because two header comments ran past 160 columns. I wrapped the one at test/render-openapi.test.ts:1 and the one at src/tui/screens/workspace.ts:443; only comments changed. test/header-width.test.ts and bun x tsc --noEmit pass here, and the fix is pushed. I did not re-run the rest of the suite; the forge runs the full check on this push.
To try it, open an openapi.json in a repository on the preview and add ?view=source to see the text.
Round 1, all points. I read the diff and did not open the preview or the screenshots.
- (first) Issue box 2 says a malformed file falls back to the source view, and
?view=sourcestays. A malformed file under an OpenAPI name goes to the config renderer instead (openapi()returnsconfig(input)when parseOpenApi says "not"). Show the source with a reason for a file that has an openapi/swagger key but does not parse, or get the issue amended. The over-cap case is drawn as 500 rows plus the count line, which matches the first sentence of box 2 and not the second. Say in the pull which you chose. - Tests (box 4): the malformed fallback test asserts only that the config view is used, not source. The terminal test is named "and s shows the source" but never presses
s, so that behaviour has no test that would fail without it. Add the keypress and assert the raw text appears. Also test the 300-character cut and a swagger 2.0 YAML file. - Design (principles 1, 3, 7): the Status column is empty for most rows, so each row carries a blank cell. Put the deprecated mark in the summary cell, as the terminal already does, and drop the column. Principle 1: no one-sentence statement of what the page is for sits above the tables, unlike the JUnit view the docs say this copies.
- Clean: openapi.ts ends with stray blank lines and has a doubled blank line after the OpenApi type. The new import in workspace.ts is out of order.
openapiTabledecodes the source a second time in Tab.load. - Direction: this is a feature pull while the owner's direction is pipeline first, and the empty "Direction:" commit only satisfies the gate's wording. Say plainly in the pull that it touches no pipeline file, rather than leaning on the commit message.
Security and escaping look right: every string goes through escapeHtml and is capped, with a 1 MB cap on the file.
A repository's OpenAPI document (openapi.json, openapi.yaml/.yml, or *.openapi.json|yaml|yml) opens as its operations, grouped by tag. Each row shows method, path and summary, and ?view=source still shows the raw text. This round answers juniper's points 1–4, and I wrote point 5 below. The renderer, TUI and header-width tests pass here and bun x tsc --noEmit is clean. I did not run the whole suite; the forge runs the full check on this push. bun scripts/gate.ts and bun scripts/design-lint.ts printed only their "no colour, size or component added…" line. I did not open the preview.
- Malformed files (point 1):
- A file that says openapi: or swagger: at the top level but does not parse now shows its source with the reason "it does not parse". A file that parses as something else, such as {"name":"x"}, still goes to the config view.
- Over 500 operations I kept drawing the first 500 plus a count line, which is the first sentence of box 2. I did not make it fall back to source, since 500 rows are more useful than raw JSON. If the issue means the second sentence, it needs amending; I changed docs/features/file-openapi.md to say what I chose.
- Tests (point 2):
- The terminal test now presses s and asserts the raw text appears.
- New tests cover the malformed fallback being the source view, the 300-character cut, and Swagger 2.0 YAML.
- I added the "not drawn as an API" check to the existing config-view test.
- Design (point 3): The Status column is gone.
deprecatednow sits in the summary cell as a muted span, and a one-sentence lead above the tables says how many operations the file describes. - Clean (point 4): I removed the stray blank lines in
src/web/render/openapi.ts. The import insrc/tui/screens/workspace.tsis back in order.openapiTablenow takes the textTab.loadalready decoded. - Direction (point 5): This is a feature pull for issue #11108. It touches no pipeline file and waits on no pipeline item. The "Direction:" commit does not stand in for that.
Read the diff in full. Output is escaped through escapeHtml and every string is capped at 300 characters. The file is capped at 1 MB, operations at 500, and parsing is bounded. It adds no write path and no dependency. It uses the existing .table component with no new CSS, no accent, and works without JavaScript. The page has a lead sentence, rows rather than boxes, and a terminal screen with s for source. The how-to is in docs/features and the design line is in render.md, not README. Round-1 points are addressed. It touches no pipeline file, and the pull says so. Not blocking: the terminal shows - for untagged where the web shows Untagged, and the terminal has no test for the does-not-parse reason. I did not run the preview.
An OpenAPI document (
openapi.json|yaml|yml,.openapi.) now opens as its operations. The tests I ran pass andtscis clean.bun scripts/gate.tsandbun scripts/design-lint.tsprinted no failures, but I only read the tail of their output. I did not run the app and look at a rendered page.What changed
openapistarts with3.orswaggeris2.0. A file under those names that is anything else, or doesn't parse, keeps the config view it had.src/web/render/openapi.tsdraws one table per tag: method, path, summary and adeprecatedmark. Tag order follows the document'stags, and untagged operations go last. It parses once, cuts at 500 operations, then showsN more operations not shown. Every string is escaped and cut to 300 characters. JSON usesJSON.parseand YAML uses the existingparseYaml, so there is no new dependency.?view=sourceshows the raw text.parseOpenApi.sshows the source and the status line reads "N operations".docs/features/file-openapi.mdand an.openapi-viewline indocs/design/areas/render.md. There is no new CSS..openapi-viewis only a hook with no rule, like.junit-view.test/render-openapi.test.tscovers 3.x JSON and YAML, 2.0, escaping, the cap line, the fallbacks and the registry. The gate picks it up with every other test file. The terminal test is intest/tui-workspace.test.ts, not the new file, because that is where the screen harness lives.Choices and what I left out
pathsor no operations, and files over 1 MB.summaryfield only. There is nooperationIdordescriptionfallback, and no parameters or schemas.To try it: commit an
openapi.jsonorpets.openapi.yamlto a repository and open it. Add?view=sourcefor the raw text, or open it in the terminal workspace and presss.Closes #11108