History

Drop em-dashes from new comments

Rhys Sullivan committed 4 months ago

Commit 69499191 parent 6a494f97 files · +13 −13Browse files

Showing the changes to packages/plugins/openapi/src (5 of 7 files). Show all

Unified · Split

5 files
  1. packages/plugins/openapi/src/sdk/extract.test.ts +1 −1
  2. packages/plugins/openapi/src/sdk/extract.ts +1 −1
  3. packages/plugins/openapi/src/sdk/ndjson-output-migration.ts +2 −2
  4. packages/plugins/openapi/src/sdk/openapi-utils.ts +1 −1
  5. packages/plugins/openapi/src/sdk/streaming-response.test.ts +1 −1
packages/plugins/openapi/src/sdk/extract.test.ts+1−1
@@ -93,7 +93,7 @@ describe("OpenAPI extract response bodies", () => { · 92 unmodified lines
93 // NDJSON endpoints (e.g. Vercel's runtime-logs) declare the schema of93 // NDJSON endpoints (e.g. Vercel's runtime-logs) declare the schema of
94 // ONE line under application/stream+json; the invoke path returns an94 // ONE line under application/stream+json; the invoke path returns an
95 // array of parsed lines, so the advertised output schema must be that95 // array of parsed lines, so the advertised output schema must be that
96 // array — not the per-line object.96 // array, not the per-line object.
97 const lineSchema = {97 const lineSchema = {
98 type: "object",98 type: "object",
99 properties: { level: { type: "string" }, message: { type: "string" } },99 properties: { level: { type: "string" }, message: { type: "string" } },
packages/plugins/openapi/src/sdk/extract.ts+1−1
@@ -265,7 +265,7 @@ const extractResponseBody = ( · 264 unmodified lines
265 * Derive an operation's output schema from its response body. NDJSON bodies265 * Derive an operation's output schema from its response body. NDJSON bodies
266 * (`application/stream+json` and friends) are spec'd per LINE but returned by266 * (`application/stream+json` and friends) are spec'd per LINE but returned by
267 * the invoke path as an array of parsed lines, so the advertised schema wraps267 * the invoke path as an array of parsed lines, so the advertised schema wraps
268 * the line schema in an array — otherwise describe previews promise a single268 * the line schema in an array; otherwise describe previews promise a single
269 * object that invocations never return. Used by both the whole-tree extract269 * object that invocations never return. Used by both the whole-tree extract
270 * and the serve path's stored-binding rebuild so the two stay in lockstep.270 * and the serve path's stored-binding rebuild so the two stay in lockstep.
271 */271 */
packages/plugins/openapi/src/sdk/ndjson-output-migration.ts+2−2
@@ -3,7 +3,7 @@ · 2 unmodified lines
3//3//
4// Extraction used to persist an NDJSON operation's PER-LINE response schema as4// Extraction used to persist an NDJSON operation's PER-LINE response schema as
5// the tool's output schema, while the invoke path returns an ARRAY of parsed5// the tool's output schema, while the invoke path returns an ARRAY of parsed
6// lines — so describe previews promised a single object that invocations never6// lines, so describe previews promised a single object that invocations never
7// returned. The producer now wraps those schemas in an array; the per-line7// returned. The producer now wraps those schemas in an array; the per-line
8// shape can't be recognized from a persisted `tool` row alone (it's just a8// shape can't be recognized from a persisted `tool` row alone (it's just a
9// JSON schema), but the stored operation bindings kept the response content9// JSON schema), but the stored operation bindings kept the response content
@@ -52,7 +52,7 @@ const tableExists = (client: SqliteDataMigrationClient, table: string) => · 42 unmodified lines
52/** Stale-mark every connection whose integration has at least one stored52/** Stale-mark every connection whose integration has at least one stored
53 * operation binding with an NDJSON response, so the next read rebuilds its53 * operation binding with an NDJSON response, so the next read rebuilds its
54 * tool rows (with array-wrapped output schemas). Returns the number of54 * tool rows (with array-wrapped output schemas). Returns the number of
55 * connections marked. Fresh databases may lack either table — nothing to55 * connections marked. Fresh databases may lack either table; nothing to
56 * migrate. */56 * migrate. */
57export const runSqliteNdjsonOutputMigration = (57export const runSqliteNdjsonOutputMigration = (
58 client: SqliteDataMigrationClient,58 client: SqliteDataMigrationClient,
packages/plugins/openapi/src/sdk/openapi-utils.ts+1−1
@@ -138,7 +138,7 @@ export const normalizeMediaType = (mediaType: string | null | undefined): string · 137 unmodified lines
138 138
139/** Media types whose bodies are newline-delimited JSON documents. The invoke139/** Media types whose bodies are newline-delimited JSON documents. The invoke
140 * path collects these streams and returns an ARRAY of parsed lines, so every140 * path collects these streams and returns an ARRAY of parsed lines, so every
141 * schema surface must describe that array — the spec convention is to declare141 * schema surface must describe that array: the spec convention is to declare
142 * the schema of ONE line (e.g. Vercel's runtime-logs endpoint). */142 * the schema of ONE line (e.g. Vercel's runtime-logs endpoint). */
143export const NDJSON_MEDIA_TYPES: ReadonlySet<string> = new Set([143export const NDJSON_MEDIA_TYPES: ReadonlySet<string> = new Set([
144 "application/stream+json",144 "application/stream+json",
packages/plugins/openapi/src/sdk/streaming-response.test.ts+1−1
@@ -279,7 +279,7 @@ describe("OpenAPI streaming responses", () => { · 278 unmodified lines
279 // The spec declares the schema of ONE line (Vercel's runtime-logs279 // The spec declares the schema of ONE line (Vercel's runtime-logs
280 // convention); the runtime returns an array of parsed lines. The280 // convention); the runtime returns an array of parsed lines. The
281 // advertised output schema must describe that array on BOTH serve281 // advertised output schema must describe that array on BOTH serve
282 // paths — the add-time compile and the stored-binding rebuild — or282 // paths (the add-time compile and the stored-binding rebuild) or
283 // agents write code against a shape that never comes back.283 // agents write code against a shape that never comes back.
284 const lineSchema = {284 const lineSchema = {
285 type: "object",285 type: "object",

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t