Commit graph

12 commits

Author SHA1 Message Date
Jeremiah Lowin
6584750667 Fix external schema reference handling in OpenAPI parser
Previously, external schema references (URLs) in OpenAPI schemas were
silently passed through and only failed during JSON schema validation
with confusing "failed to match exactly one schema" errors.

This change:
- Detects external references in _replace_ref_with_defs() and raises clear error messages
- Updates exception handlers to propagate external reference errors while preserving other error handling
- Adds comprehensive test coverage for external reference detection
- Provides helpful error messages explaining that FastMCP only supports local schema references

Fixes #926

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-25 21:25:06 -04:00
Owen W. Taylor
14d1b8a94d openapi: Rewrite recursive #/components/schemas/ references
When a schema referenced another schema as #/components/schemas/...
that wasn't properly rewritten into #/$defs/..
2025-06-20 14:34:47 -04:00
Jeremiah Lowin
a8c309f59f Make sure tests are atomic 2025-06-04 10:29:25 -04:00
ShiWei
82a987b900 add tests for _replace_ref_with_defs 2025-06-04 09:23:37 +08:00
ShiWei
6baa906813 replace nested requestBody's #/components/ with 2025-06-04 08:54:55 +08:00
Jeremiah Lowin
213abc4244 Pass client headers through to OpenAPI client 2025-05-23 12:38:24 -04:00
Jeremiah Lowin
ff318e655d Add reprs for OpenAPI objects 2025-05-14 13:42:20 -04:00
Jeremiah Lowin
56801435ac Support openapi 3.0 and 3.1 2025-04-13 22:38:37 -04:00
Jeremiah Lowin
79190e40e9 Ensure that openapi tags are transferred to MCP objects 2025-04-12 12:40:57 -04:00
zzstoatzz
16af43e272 use type 2025-04-11 03:42:00 -05:00
Jeremiah Lowin
9ca99d5809 Add OpenAPI server and tests 2025-04-10 11:16:58 -04:00
Jeremiah Lowin
a683abb8a3 Add openapi parsing utilities 2025-04-08 21:11:52 -04:00