Skip to content

fix(openapi): support path-level parameters and preserve schema types… - #2360

Merged
lbroudoux merged 1 commit into
microcks:masterfrom
shellyco-code:fix-mcp-path-parameters
Oct 16, 2026
Merged

lbroudoux merged 1 commit into
microcks:masterfrom
shellyco-code:fix-mcp-path-parameters

Conversation

@shellyco-code

Copy link
Copy Markdown
Contributor

Fixes #2359

Summary

This PR adds support for path-level parameters and preserves parameter schema types in OpenAPIMcpToolConverter.

Changes

  • Path-level parameter support: Extracted parameters defined at /paths/{path}/parameters and merged them with /paths/{path}/{verb}/parameters, allowing operation-level parameters to override path-level definitions with the same name.
  • Schema type preservation: Added parameter schema extraction so parameter types (integer, boolean, number, etc.), formats, descriptions, and enums are retained in inputSchema instead of defaulting all parameters to string.
  • Robust tool invocation: Updated getCallResponse to extract path-level parameters into pathParams, allowing proper URI pattern substitution. Added defensive argument copying to avoid modifying caller inputs or failing on immutable maps.
  • Unit Tests: Added unit tests in OpenAPIMcpToolConverterTest covering path-level parameters, parameter schema type preservation, and operation-level override behavior.

Verification

  • Run OpenAPIMcpToolConverterTest: 6 tests passing (0 failures, 0 errors).
  • Code formatted with mvn spotless:apply (passes pre-commit hook).

AI Usage Disclosure

In accordance with the Microcks AI Contribution Policy, this contribution was developed with assistance from Google Antigravity IDE (Gemini) for drafting the parameter extraction logic and test scaffolding. All changes and tests have been personally reviewed, verified, and tested.

@lbroudoux lbroudoux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton for taking the time to push this one! Greatly appreciated!

@lbroudoux
lbroudoux merged commit 2494d08 into microcks:master Oct 16, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ai): Support path-level parameters and preserve schema types in OpenAPI MCP tool converter

2 participants