fastmcp/tests/server/providers/openapi
Rishav Mitra 99eaeb8af4
fix: substitute server variable defaults when building base URL from OpenAPI spec (#3770)
* fix: resolve OpenAPI 3.x server variables in _create_default_client

When an OpenAPI spec defines server variables (e.g. `https://{region}.api.example.com/v1`),
the default values are now substituted before constructing the httpx client base URL.
Previously, the URL was used as-is, causing all requests to fail for specs that use
server variable templating.

Fixes #1681

* fix: use str.replace instead of format_map for server variable substitution

format_map applies Python string formatting rules, so variable names
like {api.version} would be treated as attribute access and raise errors.
Literal token replacement handles all valid OpenAPI variable names safely.
2026-04-06 19:48:30 -04:00
..
__init__.py Move OpenAPI to providers/openapi submodule (#2672) 2025-12-22 11:13:33 -05:00
test_comprehensive.py Fix flaky timing test on Windows CI 2026-03-02 13:28:28 -05:00
test_deepobject_style.py Move OpenAPI to providers/openapi submodule (#2672) 2025-12-22 11:13:33 -05:00
test_end_to_end_compatibility.py Move OpenAPI to providers/openapi submodule (#2672) 2025-12-22 11:13:33 -05:00
test_openapi_features.py Redact sensitive headers in OpenAPI provider debug logging (#3436) 2026-03-07 12:10:05 -05:00
test_openapi_performance.py Update Anthropic and OpenAI clients to use Omit instead of NotGiven (#3088) 2026-02-05 11:40:25 -05:00
test_parameter_collisions.py Move OpenAPI to providers/openapi submodule (#2672) 2025-12-22 11:13:33 -05:00
test_performance_comparison.py Unify discovery API: deduplicate at protocol layer only (#2919) 2026-01-18 21:01:53 -05:00
test_server.py fix: substitute server variable defaults when building base URL from OpenAPI spec (#3770) 2026-04-06 19:48:30 -04:00