Skip to content

fix(connector-openapi): path-item parameters reach every operation's input schema - #27981

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-kwainq
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-kwainq

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL

Fixes #27463

维护者速读

  • 改了什么:connector-openapi 的 collectOperations 现在把 OpenAPI 3.x Path Item 上的 parameters 合并进该路径下每个操作的参数;操作里 name + in 相同的条目整条覆盖路径级条目。另加四个固定测试和一个 patch changeset。
  • 为什么改:路径级参数从来不被读取,所以在路径上声明的必填 id(GET / PATCH / DELETE 共用的常见写法)不会出现在动作的 inputSchema 里,作者和流程设计器看到的输入定义缺了必填项。
  • 风险与回滚:只改动作的 inputSchema;运行时不会用它校验调用输入,实测缺 petId 的调用修复前后一样被派发,没有原本被接受、现在被拒绝的调用。回滚就是 revert 这一个提交。
  • 先看:packages/connectors/connector-openapi/src/openapi-connector.ts 的 collectOperations / mergeParameters。
  • 两分钟验证:pnpm --filter @objectstack/connector-openapi test -t "path-item-level",四个测试都绿;把 openapi-connector.ts 还原到 base 后,其中三个变红。
  • 需要你做的:审阅并合并。另外,经 normalize-openapi 转换的 Swagger 2.0 文档也会受益:实测升级器把路径级参数留在 path item 上,并没有下沉到操作里,与卡片描述不同。

Clause-②: no — only the generated action's inputSchema gains the path-level parameters the document already declares; nothing validates a call's input against it, so every call accepted before is still dispatched as before (measured end to end).
Metadata-protocol: none

What changes

  • collectOperations merges each path item's parameters into every operation under that path: path-level entries first, then the operation's own. An operation entry with the same name + in replaces the path-level one whole (its schema and its required), as OpenAPI 3.x defines. A path-level and an operation-level parameter that share a name but not in are both kept.
  • A path item with no parameters leaves the operation's array exactly as it was. A $ref entry has no name/in to match on, so it is kept as is; buildInputSchema skips an unresolved one, as before.
  • OpenApiPathItem declares the optional parameters key.

Why

The generator built each operation from record[method] only, so a parameter declared once on the path never reached the action's inputSchema. Measured at bacb3e6 through createOpenApiProviderFactory: an OpenAPI 3.0.3 document with '/pets/{petId}': { parameters: [{ name: 'petId', in: 'path', required: true }], get: … } materialized getPet with inputSchema: null. Agents and flows built from that schema call the action wrong.

Swagger 2.0 documents converted by normalize-openapi have the same shape: measured, the upgrader keeps path-level parameters on the path item (in 3.x form) and does not copy them into operations. They now get the same fix, and the normalizer's own tests are unchanged and green.

Verification

  • Pins in openapi-provider.test.ts, one per shape, all through the provider factory: path-level only (GET and DELETE both get petId, required), operation override (whole-entry replacement; a concatenation would keep the path-level required), same name with a different in (both kept), and the operation-only control.
  • Red first: pins 1–3 red before the fix, the control green. Ablation: with the fix reverted in the tree, the same three go red and the other 40 tests in the file stay green; restored, the file hash equals the committed one.
  • Clause-②: a real boot (LiteKernel + AutomationServicePlugin + ConnectorOpenApiPlugin, declared provider: 'openapi') runs a connector_action flow calling getPet with input: {}. It succeeds and requests the same URL before and after the fix; nothing refuses it.
  • pnpm --filter @objectstack/connector-openapi test (67/67), typecheck, pnpm lint: all exit 0. dispatch-gates --ran: 58 derived, 57 run green, 1 not measured (check:dual-build-cjs-loads needs a whole-tree build), 0 unrun.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4d1Np3hU7RQnA13YZcL

…input schema

An OpenAPI 3.x Path Item's `parameters` apply to every operation under the
path, but collectOperations built each operation from `record[method]` only,
so a parameter declared on the path (the usual vendor shape for an id shared
by GET / PATCH / DELETE) never reached the action's inputSchema.

collectOperations now merges the path item's parameters into each
operation's, an operation entry with the same `name` + `in` replacing the
path-level one whole, as OpenAPI defines. A `$ref` entry carries no key to
match on and is kept as is (buildInputSchema skips an unresolved one, as
before). Pins, one per shape, through createOpenApiProviderFactory:
path-level only, operation override, same name with different `in`, and the
operation-only control.

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4d1Np3hU7RQnA13YZcL
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 58 of 210 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 2 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 5f6dc96c396104350cfe71556ed724df5412bf54 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 998974e407cdac7ed111fab904bbcddbc37e92ae — the merge of head 86f7bf403a977c7c80b1c45067e17dbfd2f442e0 into base 5f6dc96c396104350cfe71556ed724df5412bf54, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 998974e407cdac7ed111fab904bbcddbc37e92ae && git checkout 998974e407cdac7ed111fab904bbcddbc37e92ae
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5f6dc96c396104350cfe71556ed724df5412bf54 86f7bf403a977c7c80b1c45067e17dbfd2f442e0 && git checkout -B drift-repro 5f6dc96c396104350cfe71556ed724df5412bf54 && git merge --no-ff 86f7bf403a977c7c80b1c45067e17dbfd2f442e0

node scripts/docs-audit/affected-docs.mjs --json 5f6dc96c396104350cfe71556ed724df5412bf54

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#4 · os-elon-musk · session_016WV4d1Np3hU7RQnA13YZcL

维护者速读

  • 改了什么:connector-openapi 生成动作时,把 Path Item 上声明的 parameters 合并进该路径下每个操作;操作里 name + in 相同的条目整条覆盖路径级条目。
  • 为什么改:路径级参数此前从不被读取,路径上声明的必填 id 不出现在动作的 inputSchema 里(connector-openapi: path-item-level parameters are never read, so a required path parameter declared on the path (not the operation) is missing from the action's input schema #27463)。
  • 风险与回滚:Clause-②: no,只让 inputSchema 多出文档本已声明的参数;运行时不按它校验输入,实测缺参调用修复前后同样被派发。回滚即还原本 PR。
  • 先看:openapi-connector.ts 的 collectOperations / mergeParameters。
  • 两分钟验证:pnpm --filter @objectstack/connector-openapi test -t "path-item-level",4 例全绿;还原修复后其中 3 例变红。
  • 需要你做的:无(非受管;不需契约复审;席位按本任落地授权落地)。

席位意见:ACCEPT。

席位核对

Head-sha: 86f7bf403a977c7c80b1c45067e17dbfd2f442e0

  • Shape: collectOperations merges each path item's parameters ahead of the operation's own; an operation entry with the same name + in replaces the path-level entry whole (schema and required), entries sharing a name but not in are both kept, $ref entries pass through unchanged, and a path item without parameters leaves the operation's array as it was. OpenApiPathItem gains the optional parameters key. Changeset @objectstack/connector-openapi patch, Clause-②: no, Metadata-protocol: none. check-governed-merges --pr 27981: NOT governed, 145 changed lines.
  • Premise measured: at base, an OpenAPI 3.0.3 document with a path-level required petId materialized getPet with inputSchema: null. Red first: pins 1–3 red, control green; ablation turns the same three red, the other 40 tests in the file stay green. Clause-② measured on a real boot: a connector_action call with input: {} is dispatched to the same URL before and after. Package 67/67, typecheck and lint exit 0 (os-dev report 6516333929 on connector-openapi: path-item-level parameters are never read, so a required path parameter declared on the path (not the operation) is missing from the action's input schema #27463).
  • Gate check-runs on the head: 48 runs, 35 success, 13 skipped, 0 failure/pending; mergeable_state clean.
  • Contract review: not owed (check-owed-reviews lists nothing for this PR; no spec, protocol or published contract surface in the diff).
  • Accepted deviations: none. Correction to the PR body's 速读: the card's claim that Swagger 2.0 path-level parameters are lowered into operations by normalize-openapi was measured false; those documents now benefit from this fix too, and the normalizer's own tests are unchanged.
  • Out of scope, for triage: no layer validates a connector_action call's input against the action's inputSchema.
  • Landing: under the maintainer's landing grant for this seat term (seat 4 thread, 2026-10-29 22:04Z): pr_ready + automerge_enable through the relay.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 06:33
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 06:33
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 6d5c021 Oct 30, 2026
49 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-kwainq branch October 30, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

1 participant