Repository navigation
fix(mcpx): openapi parameters resolve by (name, in) — operation overrides path level (#1669) - #3053
Conversation
…rides path level (#1669) Build concatenated path-item and operation parameters with no dedup: a path-level parameter redeclared at operation level appeared twice, putting a duplicated entry in the schema required list (invalid), and a same-name parameter in two locations was conflated into one schema property while Call sent the value to both places. resolveParams now merges by the (name, in) identity with the operation winning, and a name appearing in two locations is a Build error naming the tool, parameter and both locations. Regression tests pin both shapes; the full internal/openapi suite passes on the laptop.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Implements #1669 (queue task 4228), following the triage in task 1870.
What
Buildnow merges path-item and operation parameters through a newresolveParamsinstead of concatenating the lists. Parameter identity is the (name, in) pair per the OpenAPI spec: an operation-level parameter with the same pair as a path-level one replaces it (operation wins), exactly once inTool.Paramsand in the generated schema.Callsent the value to both places; schema and wire must not silently disagree.buildSchemacan no longer emit a duplicatedrequiredentry from this pattern.Tests
TestOperationParameterOverridesPathLevel: path-level{id, path, required}redeclared at operation level resolves to one parameter (operation declaration survives), schemarequiredlistsidexactly once.TestSameNameTwoLocationsIsABuildError: path-level{key, query}+ operation-level{key, header}fails Build with an error naming the tool,"key",queryandheader.go test ./internal/openapi/ -count=1passes on the laptop worktree; specs without path-level parameters are unchanged (existing suite green).Out of scope per the task packet: the flat tool model itself, Call required-parameter enforcement for non-path params, cookie handling, and the #1668 map-iteration nondeterminism.
Refs #1669.
Need help on this PR? Tag
@codesmith-botwith what you need.