fastmcp/tests/utilities
Bill Easton 4b59e0d94b
Fix json_schema_to_type crashes on keywords, boolean schemas, empty enums, and name collisions (#3818)
* Fix crash bugs in json_schema_to_type

- Handle boolean schemas (True/False) at the public entry point
- Append trailing underscore to Python keyword property names (PEP 8)
- Return Any for empty enum values instead of crashing Pydantic
- Deduplicate field names after sanitization to prevent collisions
  (e.g. "foo-bar" and "foo_bar" both sanitizing to "foo_bar")

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Move local imports to module level in test_json_schema_type

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com>
2026-04-11 11:29:26 -04:00
..
json_schema_type Fix json_schema_to_type crashes on keywords, boolean schemas, empty enums, and name collisions (#3818) 2026-04-11 11:29:26 -04:00
openapi Fix OpenAPI 3.0 nullable fields in tool input schemas (#3768) 2026-04-07 18:09:26 -04:00
__init__.py restore 1.x code 2025-04-09 11:54:42 -04:00
test_async_utils.py Fix async partial callables rejected by iscoroutinefunction (#3438) 2026-03-07 12:10:09 -05:00
test_auth.py feat: option to add upstream claims to the FastMCP proxy JWT (#2997) 2026-01-28 15:57:24 -05:00
test_cli.py Fix path resolution in install commands (#1951) 2025-09-29 20:04:12 -04:00
test_components.py Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
test_inspect.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_inspect_icons.py Split large test files to comply with loq line limit (#3328) 2026-02-28 11:21:11 -05:00
test_json_schema.py fix: strip discriminator after dereferencing schemas (#3682) 2026-03-28 19:46:05 -04:00
test_logging.py Add enable_rich_logging setting to disable rich formatting (#2893) 2026-01-16 20:29:29 -05:00
test_skills.py fix: prevent path traversal in skill download (#3493) 2026-03-15 11:22:13 -04:00
test_tests.py Add FASTMCP_TRANSPORT setting for default transport selection (#1796) 2026-03-02 18:08:59 -05:00
test_token_cache.py Extract TokenCache utility, add caching to GitHubTokenVerifier (#3547) 2026-03-18 15:26:09 -04:00
test_typeadapter.py Fix method-bound tools (#1360) 2025-08-04 09:41:05 -04:00
test_types.py Preserve kw-only defaults when rebuilding functions for resolved annotations (#3429) 2026-03-07 12:10:01 -05:00
test_version_check.py Add CLI update notifications (#2840) 2026-01-10 18:27:03 -05:00